title: Using dapper with JOIN
body: <p>I have a query with a number of joins like:</p>
  
  <pre><code>var sqlFindByProviderNameAndProviderSubjectId = $@"
       SELECT u.*, la.*, p.*, cp.*, scr.*, lm.*, wm.*
       FROM [user].[User] u
       LEFT JOIN [user].[LinkedAccount] la ON u.Id = la.UserId
       LEFT JOIN [user].[PatientProfile] p ON u.Id = p.UserId
       LEFT JOIN [user].[CareProviderProfile] cp ON u.Id = cp.UserId                
       LEFT JOIN [user].[Screening] scr ON u.Id = scr.UserId
       LEFT JOIN [user].[LengthMeasurement] lm ON scr.Id = lm.ScreeningId
       LEFT JOIN [user].[WeightMeasurement] wm ON scr.Id = wm.ScreeningId                 
                  WHERE u.Id = (
                      SELECT UserId
                      FROM [user].[LinkedAccount] la
                      WHERE la.ProviderName = @ProviderName AND la.ProviderSubjectId = @ProviderSubjectId)";
  </code></pre>
  
  <p>I use dapper to dematerialize the tables into strongly typed entities like:</p>
  
  <pre><code>await UnitOfWork.Connection.QueryAsync&lt;User, LinkedAccount, PatientProfile, CareProviderProfile, Screening, LengthMeasurement, WeightMeasurement, User&gt;(query,
      (u, la, p, cp, scr, lm, wm) =&gt;
      {
          // mapping code here
      }
  </code></pre>
  
  <p>This works fine.</p>
  
  <p>However, I have to add one additional JOIN to the query, but unfortunately the QueryAsync&lt;> takes maximum 7 parameters/types, and I have more.</p>
  
  <p>Is there another way to map multiple tables from a JOIN into entities? </p>