You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Entity Model definition:
...
public Dictionary<EnumOne, string>? DictionaryProp { get; set; }
...
when I materialize any object I have the error:
System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection. Arg_ParamName_Name'
If I change in the EntityTypeConfiguration the OwnsOne with entity.Ignore(e => e.DictionaryProp); all working so I detect that the problem is in it.
The problem before was putting the property name on ToJson becouse EFCore.NamingConventions 8.0.0-rc.2 not work well yet but I see that already are working on it.
Thanks
The text was updated successfully, but these errors were encountered:
EF's ToJson support does not support arbitrary dictionaries, only strongly-typed mappings. If you need to use such a dictionary, you have to stay with the traditional Npgsql-specific POCO design. I'll update the docs to reflect this.
When pass from Npgsql.EntityFrameworkCore.PostgreSQL 7.0.11 to Npgsql.EntityFrameworkCore.PostgreSQL 8.0.0
Project File:
all runtime; build; native; contentfiles; analyzers; buildtransitive ......
all
runtime; build; native; contentfiles; analyzers; buildtransitive
Fluent EntityTypeConfiguration:
...
#if NET8_0_OR_GREATER
entity.OwnsOne(e => e.DictionaryProp, d => d.ToJson("dictionary_prop"));
#else
entity.Property(e => e.DictionaryProp).HasColumnType("jsonb");
#endif
...
Entity Model definition:
...
public Dictionary<EnumOne, string>? DictionaryProp { get; set; }
...
when I materialize any object I have the error:
System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection. Arg_ParamName_Name'
If I change in the EntityTypeConfiguration the OwnsOne with entity.Ignore(e => e.DictionaryProp); all working so I detect that the problem is in it.
The problem before was putting the property name on ToJson becouse EFCore.NamingConventions 8.0.0-rc.2 not work well yet but I see that already are working on it.
Thanks
The text was updated successfully, but these errors were encountered: