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
I have a database which has a composite type called 'tdatespan'.
CREATETYPEpublic.tdatespan AS
(
"Years" int16notnull,
"Months" int16notnull,
"Days" int16notnull
);
Unfortunately I can't get this to work in Entity Framework Core (version "Npgsql.EntityFrameworkCore.PostgreSQL" is 8.0.0).
The following error message throws: System.InvalidOperationException: 'The 'DateSpan' property 'ProductEntity.BestBefore' could not be mapped because the database provider does not support this type. Consider converting the property value to a type supported by the database using a value converter. See https://aka.ms/efcore-docs-value-converters for more information. Alternately, exclude the property from the model using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.'
Unfortunately, composite types aren't currently supported by the EF provider. This is something I hope to implement (and there's infrastructure development on the EF side that goes in this direction), but it's currently not there.
I have a database which has a composite type called 'tdatespan'.
Unfortunately I can't get this to work in Entity Framework Core (version "Npgsql.EntityFrameworkCore.PostgreSQL" is 8.0.0).
The following error message throws:
System.InvalidOperationException: 'The 'DateSpan' property 'ProductEntity.BestBefore' could not be mapped because the database provider does not support this type. Consider converting the property value to a type supported by the database using a value converter. See https://aka.ms/efcore-docs-value-converters for more information. Alternately, exclude the property from the model using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.'
This is my test setup:
However, if I read directly via DataReader instead of EntityFrameworkCore, it works without any problems:
Enums are working with EntityFramework and DataReader.
The text was updated successfully, but these errors were encountered: