I have encountered this problem for a long time. Add this method (if it does not exist) to the DbContext:
protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity<Class1>().Property(rec => rec.Rate).HasPrecision(20, 15); }
when you declare such a variable in EF and donβt mention how much precision the floating-point number has, so the EF Engine assumes the default value (decimale (18,2))
source share