title: How to get values for child objects using Dapper ORM?
body: <p>I am retrieving profile details with the following:</p>
  
  <pre><code>var profiles = connection.Query&lt;Models.PROFILE&gt;(
      "SELECT * FROM PROFILES WHERE ID=@ID", 
      new { ID = profileID }); // IEnumerable
  var profile = profiles.First&lt;Models.PROFILE&gt;();
  </code></pre>
  
  <p>The profile object contains other collections like profileImages.  The problem is that the item count for every child object is zero.  Also I only want to get data for say, profileImages.  </p>
  
  <p>Is there something that needs to be set to query the child objects, and if so, is it possible to specify which one and for how many levels?</p>
  
  <p>I have also tried multimapping:</p>
  
  <pre><code>var profiles = connection.Query&lt;Models.PHOTOS_PERMISSIONS,
                                  Models.PROFILE,
                                  Models.PHOTOS_PERMISSIONS&gt;(sql,
                      (p1, p2) =&gt; { p1.ID = profileID; return p1; }, 
                      new { ID = profileID }, 
                      splitOn: "OWNER_PROFILESIDFK, ID").AsQueryable();
  
  PHOTOS_PERMISSIONS.OWNER_PROFILESIDFK = PROFILE.ID
  </code></pre>
  
  <p>And getting the following error:</p>
  
  <blockquote>
    <p>When using the multi-mapping APIs ensure you set the splitOn param if
    you have keys other than Id Parameter name: splitOn</p>
  </blockquote>
  
  <p>I have tried variations of what's in my splitOn text, but still get the same error.</p>