title: Map stored procedure with multiple resultset returned in EF Core
body: <p>I am currently migrating an already established website from old ASP.NET to ASP.NET Core 2.2. The database is a shared database across other platforms and is also established therefore I cannot just changed anything from it.</p>
  
  <p>I came across to this problem when I had to call a stored procedure from EF Core where this stored procedure returns 3 result sets. The result set of the stored procedure is like this.</p>
  
  <p><strong>Table 1</strong></p>
  
  <pre><code>ColumnName1 | ColumnName2 | SomeColumn | AndMoreColumns
  ------------+-------------+------------+---------------
  Value1      | value 2     | value 3    | Value 4
  </code></pre>
  
  <p><strong>Table 1</strong></p>
  
  <pre><code>Column1    | Column2
  -----------+----------
  value1     | value 2
  </code></pre>
  
  <p><strong>Table 3</strong></p>
  
  <pre><code>Column1
  -------
  Value1
  </code></pre>
  
  <p>Table 1 and table 2 are related to each other. This table will always return 1 row on table 1 and table 2 can return multiple rows while table 3 is static.</p>
  
  <p>Now, my question is. How do I map this result set to an EF Core <code>Query&lt;T&gt;</code> model builder? I want to map it per column name since I want to make the column names more friendly. An example that I had that did not work is like this.</p>
  
  <pre><code>modelBuilder.Query&lt;MyModel&gt;(a =&gt; 
  {
      a.Property(b=&gt;b.ModelId).HasColumnName("ColumnName1");
      a.Property(b=&gt;b.ModelName).HasColumnName("ColumnName2");
      ...
  });
  </code></pre>
  
  <p>but unfortunately, the above mapping did not work. Especially for the 2nd table.</p>