-
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
EF Core 6 Dictionary<string, object> map to jsonb #2134
Comments
Similar issue public int? GroupId { get; set; }
[Column(TypeName = "jsonb")]
public DataDictionary Group { get; set; }
|
This is a problem in EF Core itself - protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<...>().Property(b => b.ExtensionData).Metadata.SetProviderClrType(null);
} Note that |
to resolve this problem in once code. foreach (var item in modelBuilder.Model.GetEntityTypes())
{
foreach (var p in item.ClrType.GetProperties())
{
if (p.GetCustomAttribute<ColumnAttribute>()?.TypeName == "jsonb")
{
modelBuilder.Entity(item.ClrType).Property(p.Name).Metadata.SetProviderClrType(null);
}
}
} |
this code in EF Core 5 work correct.
and in ef core 6.0.throw a error
The text was updated successfully, but these errors were encountered: