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

BulkExtensions is not recognizing a field configured with "OwnsMany" #1456

Open
rafael-ferreira-maersk opened this issue Apr 10, 2024 · 1 comment
Labels

Comments

@rafael-ferreira-maersk
Copy link

rafael-ferreira-maersk commented Apr 10, 2024

I have a DbContext configured like this for a specific field:

modelBuilder.Entity<Object1>()
                .OwnsMany(x => x.ListField, builder => { builder.ToJson(); });

Then using BulkSaveChangesAsync, in the MERGE command there's a gap in that field:

SELECT 
...
    JSON_QUERY([m].[ListField], '$')
FROM (
        SELECT [Id],
            ...
            (no mention of ListField)
        FROM [dbo].[Object1Temp87fb13faOutput]
        WHERE [Id] IS NOT NULL

How can I fix this?
Thank you!

@borisdj
Copy link
Owner

borisdj commented Apr 11, 2024

The field needs to be explicitly defined in the entity as well if it it not already.
Otherwise write entire code snippet or a test where the issue would be reproducible.

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

No branches or pull requests

2 participants