create model and validation model in C# code example
Example: C# validaion
public string Name
{
get { return Name; }
set {
if(string.IsNullOrEmpty(value))
throw new ArgumentException
("Name cannot be blank","Name");
Name = value;
}
}