I would like to know if is there any interface like IValidatableObject but for test the inputs for ModelState, something like that:
public class EditUserViewModel: IAnyInterface
{
public string Name{get;set;}
public string Age{get;set;}
public IEnumerable<ModelStateError> Validate()
{
if(//something)
yield new ModelStateError("error");
}
}
ps: I don't want to use data annotation!