How to set "Value" foo "for Number is invalid." error message?

[MetadataType(typeof(PersonMetaData))]
public partial class Person {
    public class PersonMetaData {
        [Required(ErrorMessage="The number is required")]
        public object Number {get;set;}
    }
}

This error message is displayed when the number field is empty and when there is an invalid input that it gives "The value" foo "is not valid for the number.". How to configure the last error message?

+3
source share

Source: https://habr.com/ru/post/1756007/


All Articles