Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BulkUpdate and BulkMerge Do Not Apply Any Changes To The Table with Owned Entity #568

Open
xbaha opened this issue Jan 8, 2024 · 1 comment
Assignees

Comments

@xbaha
Copy link

xbaha commented Jan 8, 2024

My table class looks like this:

    public class ChannelsHistory
    {
        [Key]
        public string Id{ get; set; }
        public List<ChannelsHistoryPeriod> ChannelsHistoryDailies { get; set; } = new List<ChannelsHistoryPeriod>();
        public List<ChannelsHistoryPeriod> ChannelsHistoryWeekly { get; set; } = new List<ChannelsHistoryPeriod>();
    }

    public class ChannelsHistoryPeriod
    {
        public DateOnly Date { get; set; }
        public ulong ViewCount { get; set; }
    }

This code to convert to a json (.Net7 and .Net8 supported)

            builder.Entity<ChannelsHistory>().OwnsMany(s => s.ChannelsHistoryDailies, options =>
            {
                options.ToJson();
            });
            builder.Entity<ChannelsHistory>().OwnsMany(s => s.ChannelsHistoryWeekly, options =>
            {
                options.ToJson();
            });

When i do BulkUpdate or BulkMerge , nothing changes, there is no error or exception, the rows are still the same.
SaveChanges works fine.

I am not sure if this type is supported or not?

@JonathanMagnan JonathanMagnan self-assigned this Jan 8, 2024
@JonathanMagnan
Copy link
Member

Hello @xbaha ,

Thank you for reporting. At this moment, our library doesn't yet support the ToJson() options.

However, that's something we are currently looking at in our short-term plan. So we hope the support will come soon, but I cannot provide you with any date yet.

So the issue is really about the ToJson() option not being supported yet

Best Regards,

Jon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants