In an ASP.NET Core 2.0 application, I have a Foo class with a lot of classical string or numeric members and also a int? Budget fi
My biggest finding was to ensure you are not just rendering the field via your own tag within the .cshtml; rather, ensure you are using the @Html.EditorFor() syntax to render the field:
@Html.EditorFor(model => Model.AmountPaid)
Once I used this, the validation worked correctly. You can also decorate your field, such as:
[DataType(DataType.Currency)]
[Column(TypeName = "decimal(18, 2)")]
public decimal AmountPaid { get; set; }
https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/validation?view=aspnetcore-2.2