title: Year in Nullable DateTime
body: <p>How can I calculate year in a <code>nullable</code> date? </p>
  
  <pre><code>partial void AgeAtDiagnosis_Compute(ref int result)
  {
      // Set result to the desired field value
      result = DateofDiagnosis.Year - DateofBirth.Year;
      if (DateofBirth &gt; DateofDiagnosis.AddYears(-result))
      {
        result--;
      }
  }
  </code></pre>
  
  <p>The error is: </p>
  
  <pre><code>'System.Nullable&lt;System.DateTime&gt;' does not contain a definition for 'Year' and no 
   extension method 'Year' accepting a first argument of 
   type 'System.Nullable&lt;System.DateTime&gt;' could be found (are you missing a using 
   directive or an assembly reference?)   
  </code></pre>