EF retrieves incorrect decimal precision
In Entity Framework Core you can do:
[Column(TypeName = "decimal(19,4)")]
public decimal MyDecimal { get; set; }
Turns out I needed to specify the precision the same way, but in the fluent mapping for ClassA
. Specifying it in OnModelCreating()
didn't do it, but in the fluent mapping did. Specifically:
Property(u => u.MyDecimal).HasPrecision(19, 4);