Lets says I have the following model
public class Person
{
[NameIsValid]
public string Name { get; set;}
public string LastName { get; set; }
}
I created a custom attribute NameIsValid for this model. Lets says for ViewA I need the custom attribute validation in the model, but for ViewB I dont need this custom validation attribute, how can I dinamically set or remove the custom attribute from the model when need it?
Thanks!