get and set in class in c# code example
Example: c# properties making string required
using System.ComponentModel.DataAnnotations;
{
[Required(ErrorMessage = "DocumentType is required.")]
public string DocumentType
{
get { return _documentType; }
set { _documentType = value; }
}
}