Using Asp.Net MVC 5 I need to create a required message in the following format:
"Required field! [Registered name]"
Normally it would look like this:
[Required(ErrorMessage = "Campo de preenchimento obrigatório! [Razão Social]")]
[Display(Name = "Razão Social")]
[StringLength(60)]
public string RazaoSocial { get; set; }
I would like to use the ErrorMessag of Required or Name that is in the Display. So by changing this value the name will change automatically in the message.