Is it possible to edit a data type error message on EF?
For example, I have to show the end user that the value entered on ID field must be integer.
the value entered on ID field must be integer
public int ID { get; set; }
Thank you so much!
You can use regular expression annotation to check only numbers
[RegularExpression(@"^\d+$",ErrorMessage="the value entered on ID field must be integer")] public int MyInt { get; set; }
You can use Range checker:
[Range(int.MinValue, int.MaxValue, ErrorMessageResourceName = "IDMustBeInteger", ErrorMessageResourceType = typeof (Resources))]
, :
, ( regexp - )
ModelBinder .
ModelBinder