-
Notifications
You must be signed in to change notification settings - Fork 223
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
Jsonb[] mapping not working #3131
Comments
I think my problem is related to this issue. Have you found a way to fix it? |
same issue here when migrating from .net 6 to .net 8 |
dotnet/efcore#33913 It's a bug already reported, we're waiting for the resolution |
I have a similar problem when migrating from .net7 to .net 8 |
I've got a similar exception when updated the version of Npgsql.EntityFrameworkCore.PostgreSQL to 8.0.4 from 6.0.7. I rolled back to 8.0.0
For 8.0.6 with EnableDynamicJson I've got Updated: I have all the errors disappeared and on the latest version (8.0.4) . When I stopped using obsolete method BatchDelete from EFCore.BulkExtensions and replaced it with ExecuteDelete. But enabling EnableDynamicJson is also necessary |
Hi,
I am using these packages in my .Net Core 8project :
My DBContext looks like this :
services.AddDbContext<MyDbContext>( options => options.UseNpgsql(connectionStrings.ReadOnlyConnectionString) .UseSnakeCaseNamingConvention() .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking)
When I am trying to map the jsonb[] (jsonb Array) using OwnsMany it's throwing error. I have added the mapping like this in the OnModelCreating :
builder.Entity<SomeEntity>() .OwnsMany(auth => auth.AllContent, d => { d.ToJson("all_content"); });
I have defined my POCO class as :
When I am trying to access my Entity I am getting error : "Reading as 'System.String' is not supported for fields having DataTypeName 'jsonb[]'\nType 'String' required dynamic JSON serialization, which requires an explicit opt-in; call 'EnableDynamicJson' on 'NpgsqlDataSourceBuilder' or NpgsqlConnection.GlobalTypeMapper (see https://www.npgsql.org/doc/types/json.html and the 8.0 release notes for more details). Alternatively, if you meant to use Newtonsoft JSON.NET instead of System.Text.Json, call UseJsonNet() instead."
Is jsob[] supported currently if yes Please suggest how to access jsonb[] or am I missing something. Thanks in Advance.
The text was updated successfully, but these errors were encountered: