FlexLabs.Upsert
FlexLabs.Upsert copied to clipboard
Does not insert OwnsOne columns
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.
I've also experienced this after using the new .ToJson()
EF API.
Worked flawlessly before when using the .HasColumnType("jsonb")