Say you have the following model:
public class foo
{
[Required]
public string Email { get; set; }
[Required]
public string Password { get; set; }
[Required]
public string FullName { get; set; }
}
But you want to exclude FullName from the modelvalidation because you are using the model also in a place where FullName is not filled in, you can do so in the following way:
ModelState.Remove("FullName");