title: C# optional properties in C# 3.0 (2009)
body: <p>I am wondering if C# supports optional properties as the following</p>
  
  <pre><code>public class Person
  {
      public string Name { get; set;}
      public optional string NickName { get; set;}
      ...many more properties...
  }
  </code></pre>
  
  <p>so that when I create a Person object I can easily check the validity of input values in a simple loop</p>
  
  <pre><code>public bool IsInputOK(Person person)
  {
      foreach( var property in person.GetType().GetProperties())
      {
          if( property.IsOptional())
          {
               continue;
          }
          if(string.IsNullOrEmpty((string)property.GetValue(person,null)))
          {
               return false;
          }
      }
      return true;
   }
  </code></pre>
  
  <p>I have searched on google but didn't get desired solution. Do I really have to hand code validation code for each property manually?</p>
  
  <p>Thanks. </p>