È possibile utilizzare una singola annotazione/attributo di dati per più proprietà?Esiste un modo per utilizzare un'annotazione/attributo di dati con più proprietà?
Invece di:
[Required]
public string Name {get;set;}
[Required]
public string Something {get; set;}
[Required]
public string Everything {get;set;}
Un attributo per tre proprietà:
[Required]
public string Name {get;set;}
public string Something {get; set;}
public string Everything {get;set;}
So che il secondo blocco di codice imposta solo nome per non nullo, ma c'è un modo per fare tutte e tre le proprietà non nulla con un solo attributo [obbligatorio]?