Code sample:
Model:
[Required(ErrorMessage = "Campo CPF ou CNPJ obrigatório")]
[Display(Name = "CPF")]
public string CPF { get; set; }
[Display(Name = "CNPJ")]
public string CNPJ { get; set; }
User must fill in one of the CPF or CNPJ fields (either he fills in the CPF, or he fills in the CNPJ). How can I do this with DataAnnotation
?