title: Reflection - check all nullable properties have values
body: <p>I have to loop through all the properties in a few classes and check any nullable properties to see if they have a value.  How do I cast the value returned from propertyInfo.GetValue() to a generic nullable type so that I can check the HasValue property?</p>
  
  <p>Code snipped for brevity:</p>
  
  <pre><code>foreach (PropertyInfo propInfo in this.GetType().GetProperties())
  {
      if (&lt;Snip: Check to see that this is a nullable type&gt;)                                                                      
      {
             //How do i cast this properly in here to allow me to do:
             if(!((Nullable)propInfo.GetValue(this, null)).HasValue)
                    //More code here
      }
  }
  </code></pre>