title: Check to see if a given object (reference or value type) is equal to its default
body: <p>I'm trying to find a way to check and see if the value of a given object is equal to its default value. I've looked around and come up with this:</p>
  
  <pre><code>    public static bool IsNullOrDefault&lt;T&gt;(T argument)
      {
          if (argument is ValueType || argument != null)
          {
              return object.Equals(argument, default(T));
          }
          return true;
      }
  </code></pre>
  
  <p>The problem I'm having is that I want to call it like this:</p>
  
  <pre><code>            object o = 0;
              bool b = Utility.Utility.IsNullOrDefault(o);
  </code></pre>
  
  <p>Yes o is an object, but I want to make it figure out the base type and check the default value of that. The base type, in this case, is an integer and I want to know in this case if the value is equal to default(int), not default(object).</p>
  
  <p>I'm starting to think this might not be possible.</p>