Check out example codes for "C# validaion". It will help you in understanding the concepts better.

Code Example 1

public string Name
				  {
				   get { return Name; }
				   set {
				  	 if(string.IsNullOrEmpty(value))
				  		 throw new ArgumentException
				  		 ("Name cannot be blank","Name");
				  	 Name = value;
				  	 }
				  }

Learn ReactJs, React Native from akashmittal.com