FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
159 stars 65 forks source link

Entity Framework Core Firebird can't scaffold columns with NUMERIC type #1191

Open Camel-RD opened 2 weeks ago

Camel-RD commented 2 weeks ago

When I try to scaffold a table with a column of type NUMERIC(x,y), I get this error "Could not find type mapping for column..."

It seems like FbTypeMappingSource doesn't have a case for NUMERIC column type.

gilsonjoanelo commented 2 days ago

There was a similar error with this one when mapping a company database. Since we use Code First, I solved it by putting this configuration in the mapping .HasColumnType("NUMERIC(15, 6)").

To declare it as an attribute, you have to use [Column(TypeName = "NUMERIC(15, 6)")], which also solves the problem. At least I no longer had the exception reported.