Is there a way to reuse data annotations?
问题 Is there a way to implement the idea of a data domains (at a property level) inside of a class that is used as a model in a view in ASP.Net MVC 4? Consider this code: public class LoginProfileModel { [DisplayName("Login ID")] [Required(ErrorMessage = "Login ID is required.")] public string LogonID { get; set; } [DisplayName("Password")] [Required(ErrorMessage = "Password cannot be blank.")] [StringLength(20, MinimumLength = 3)] [DataType(DataType.Password)] public string Password { get; set;