I have been using the following property in my entity
public decimal smallamount { get; set; }
It persists to a SQL Server column of type smallmoney
.
I get a warning
No type was specified for the decimal column "smallamount" on entity type jobline.
This will cause values to be silently truncated if they do not fit in the default precision and scale.
Explicitly specify the SQL Server column type that can accommodate all the values using 'ForHasColumnType()'.
I gather I can use a column attribute
For example
[Column(TypeName = "decimal(10, 2)")]
Or alternatively use the modelbuilder HasPrecision
property.
But where can I find out what precision I should use?