title: How can I make my string property nullable?
body: <p>I want to make the Middle Name (<code>CMName</code>) of person optional. I have been using C#.net code first approach. For integer data type its easy just by using <code>?</code> operator to make in nullable. I am looking for a way to make my sting variable nullable. I tried to search but could not find the way to make it nullable.</p>
  <p>Below is my code. Please suggest me how to make it nullable.</p>
  <pre><code>public class ChildrenInfo
  {
      [Key]
      public int ChidrenID { get; set; }
  
      [Required]
      [Display(Name =&quot;First Name&quot;)]
      [StringLength(50,ErrorMessage =&quot;First Name cannot exceed more than 50 characters&quot;)]
      [RegularExpression(@&quot;^[A-Z]+[a-z]*$&quot;,ErrorMessage =&quot;Name cannot have special character,numbers or space&quot;)]
      [Column(&quot;FName&quot;)]
      public string CFName { get; set; }
  
      [Display(Name =&quot;Middle Name&quot;)]
      [RegularExpression(@&quot;^[A-Z]+[a-z]*$&quot;,ErrorMessage =&quot;Middle Name cannot have special character,numbers or space&quot;)]
      [StringLength(35,ErrorMessage =&quot;Middle Name cannot have more than 35 characters&quot;)]
      [Column(&quot;MName&quot;)]
      public string CMName { get; set; }
  }   
  </code></pre>