title: Why DapperRow.GetType() return null?
body: <p>As far as I knew, Object.GetType() should never return null. (<a href="https://stackoverflow.com/questions/2201007/can-object-gettype-ever-return-null">related discussion</a>)</p>
  
  <p>Dapper .Query() return private class DapperRow instances to be treated as dynamic objects.  I found a strange thing: DapperRow's .GetType() return null.</p>
  
  <p>Here's the sample code to reproduce the problem.  Create a C# project, reference Dapper and open a connection to SQL Server (or other database), use .Query() to execute simple select query and retrieve the first row of result.  Use GetType() to get the type of result object, the return value is null. </p>
  
  <pre><code>using (SqlConnection cn = new SqlConnection(csSql))
  {
      var rec = cn.Query("select getdate() as D").Single();
      var t = rec.GetType(); // t == null
      Console.WriteLine(t.Name); // null reference exception
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/GfiQb.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GfiQb.gif" alt="enter image description here"></a></p>
  
  <p>I suspect that dynamic or private type is the cause of null, so I write my class library for test:</p>
  
  <pre><code>namespace Lib
  {
    public class Blah
    {
      public static dynamic SecretObject;
      static Blah()
      {
          SecretObject = new PrivateType();
      }
    }
    class PrivateType
    {
    }
  } 
  </code></pre>
  
  <p>In another project, get the dynamic type static field and call GetType():</p>
  
  <pre><code>    dynamic obj = Lib.Blah.SecretObject;
      Console.WriteLine(obj.GetType().Name); // "Lib.PrivateType"
  </code></pre>
  
  <p>According to the test result, even cast private type as dynamic, I still can get the private type information from GetType(), why DapperRow.GetType() return null? </p>