title: Calculate Age in C#
body: <p>Can someone please help me write some code to calculate age at a particular date based on date of birth in years.</p>
  
  <p>I'm capturing date of Birth and Date of Diagnosis in database and would like to calculate age in years by Diagnosis date. </p>
  
  <pre><code>partial void AgeAtDiagnosis_Compute(ref string result)
      {
          // Set result to the desired field value
  
      }
  </code></pre>