csharp properties making string required

Code Example - csharp properties making string required

                
                        using System.ComponentModel.DataAnnotations;

{
  [Required(ErrorMessage = "DocumentType is required.")]
  public string DocumentType 
  { 
      get { return _documentType; }
      set { _documentType = value; }
  }
}