Model validation: data annotations?
Decorate models with attributes:
public class User {
[Required]
[StringLength(50)]
[EmailAddress]
public string Email { get; set; }
Used in both MVC and API for validation.
Decorate models with attributes:
public class User {
[Required]
[StringLength(50)]
[EmailAddress]
public string Email { get; set; }
Used in both MVC and API for validation.