title: C# - Check if integer property is set
body: <p>I'm validating some properties and I need to know if long or integer values are set by other layers.</p>
  
  <p>For example, this class::</p>
  
  <pre><code>public class Person 
  {
      public int Age {get;set;}
  }
  </code></pre>
  
  <p>When I set a new instance of <strong>Person</strong>, the <strong>Age</strong> gets the value 0. But I have to validate if the <strong>Age</strong> were set, because the <strong>Age</strong> can be zero (not in this context of course).</p>
  
  <p>One solution that I've thought of is to use the int as a nullable integer (<strong>public int? Age</strong>) and in the constructor of <strong>Person</strong> set the Age as null.</p>
  
  <p>But I'm trying to avoid it because I would have to change too many classes just to check if <strong>Age.HasValue</strong> and to use it as <strong>Age.Value</strong>.</p>
  
  <p>Any suggestions?</p>