Uppercase attribute that converts the input to uppercase
I am working in MVC4 and want to define a model using an Uppercase attribute. The idea would be that the presence of the Uppercase attribute would cause the model value to be converted to uppercase when it arrived at the server. At the moment I have the following code within the model: [Required] [Display(Name="Account Code")] [StringValidation(RegExValidation.AccountCode, Uppercase=true)] public string Account { get { return _account; } set { if (value != null) _account = value.ToUpper(); } } But what I would really like is this: [Required] [Display(Name="Account Code")] [StringValidation