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

Does not insert OwnsOne columns #156

Open
adminnz opened this issue Dec 12, 2023 · 1 comment
Open

Does not insert OwnsOne columns #156

adminnz opened this issue Dec 12, 2023 · 1 comment

Comments

@adminnz
Copy link

adminnz commented Dec 12, 2023

My postgresql database has:

CREATE TABLE events
(
    ...
    error_details JSONB NULL
    ...
)

In my model i have:

modelBuilder.Entity<Event>().OwnsOne(x => x.ErrorDetails, builder => builder.ToJson("error_details"));

Which when using the ef core Add(..) or Update(..) methods correctly serializes the nested object to json and stored.

But using Upsert(...) the resulting sql does not produce the error_details column.

When i look at the ef core EntityType model, the error_details is not listed in the GetProperties(), so I don't know where it is meant to be fetched from.

@kristian-dam-bori
Copy link

kristian-dam-bori commented Jan 9, 2024

I've also experienced this after using the new .ToJson() EF API.

Worked flawlessly before when using the .HasColumnType("jsonb")

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

No branches or pull requests

2 participants