-
Notifications
You must be signed in to change notification settings - Fork 225
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
Support for EF core 7.0 ToJson() (owned entity JSON modeling) #2548
Comments
The Npgsql provider will not be supporting EF's new ToJson in version 7.0, but we plan to enable this in version 8.0 and converge JSON support. The Npgsql provider has had its own support for a long time, and while the EF support is based on owned entities (and will therefore unlock partial updates in the future), the Npgsql support is based on simple type mapping instead. Unfortunately, the EF 7.0 feature won't support everything that Npgsql currently supports (e.g. weakly-typed mapping via JsonDocument). Note that for 7.0 GA, ToJSON is specifically blocked in model validation when using the Npgsql provider, to make sure users understand the different in JSON support (see #2452). Keeping this issue to track supporting EF's ToJson in 8.0. |
There are already preview versions for .NET 8 on NuGet, but I didn't find a branch or release notes on what those contain. I suppose the JSON support is still not in? |
@markushaslinger I absolutely do intend to do this for 8.0, but the PG work has been delayed for now (that's also why there aren't yet later preview versions). But this is something I'll be tackling in the coming weeks, I hope you'll be able to use a fully functional rc1 release including ToJson() support. |
Hi, @roji, rc1 is out. Did you implement that thing and if so where I can find docs? |
@hrytskivr I did not. |
@roji great stuff. If you get an indication on when this might be out let us know. Super excited to use this! |
Everyone, I've unfortunately been very busy with high-priority work, and did not get to this yet; this feature won't yet be available in 8.0.0-rc.2 which is coming out next week. However, it will be one of my top priorities for getting done for the actual 8.0.0 release. It isn't good to add a feature so late, but it's better than nothing... |
Hello. I am sorry, I didn't know where is the good place to post this question. |
@alvanrahimli that depends on what exactly you're doing with those columns - certain things may not work. I'd recommend trying to migrate gradually and carefully testing. |
Hi,
I am trying to use the new EF core 7.0.* ToJson method to map my entity to a json column.
And When I do migration, I get "Sequence contains no elements" in Npgsql.EntityFrameworkCore.PostgreSQL.Metadata.Internal.NpgsqlAnnotationProvider.For(IColumn column, Boolean designTime)+MoveNext()
Is this supported and if not, will it be?
Thanks
The text was updated successfully, but these errors were encountered: