title: Dapper multiple objects from one row
body: <p>I have one row coming from the database</p>
  
  <pre><code>select "John" Name, 
         "Male" Gender,
         20 Age,
         "Rex" PetName,
         "Male" PetGender,
         5 PetAge
         // ... many more ...
  </code></pre>
  
  <p>Using Dapper, I'd like to pull this row into two objects:</p>
  
  <pre><code>class Person
  {
      public string Name { get; set; }
      public string Gender { get; set; }
      public int Age { get; set; }
      // ... many more ...
  }    
  class Pet
  {
      public string PetName { get; set; }
      public string PetGender { get; set; }
      public int PetAge { get; set; }
      // ... many more ...
  }
  </code></pre>
  
  <p>Note: there is no hierarchical relationship here, I'm simply trying to map one database row into two (or more) objects.</p>
  
  <p>How can I do this using dapper?  </p>
  
  <ul>
  <li>I know I can do this by returning a dynamic and mapping each object manually, which is painful as in my scenario we have a large number of columns.  I'd rather not do this.  (And no, it can't be redesigned to require less columns.)</li>
  </ul>
  
  <p>What I've tried:</p>
  
  <ul>
  <li>I've looked into <code>QueryMultiple&lt;Person,Pet&gt;</code>, but it assumes I am running multiple queries. In my real-life scenario, this is a very expensive query, and I'd like to just run it once.  </li>
  <li>I've also looked into returning <code>Query&lt;Person,Pet,Tuple&lt;Person,Pet&gt;&gt;</code>, but this requires an <code>Id</code> column, here there's no hierearchical relationship or <code>Id</code>s. I just want to take a single row and map it to multiple columns. </li>
  </ul>