title: How can I get the actual result of a Stored Procedure using .NET CORE?
body: <p>Just ramping up on .NET Core and running into some unsolvable problems.
  I have a stored procedure called GetLeads whose schema basically returns</p>
  
  <pre><code>LEADID (INT)
  SALENO (INT)
  OFFICE (INT)
  PACKAGE (NVARCHAR(4)
  SALEDATE (DATETIME)
  </code></pre>
  
  <p>For sake of an example, there is a table in the same database where that Stored Procedure resides called Prospects. Its schema is</p>
  
  <pre><code>LEADID (INT)
  FNAME (NVARCHAR(50))
  LNAME (NVARCHAR(50))
  ADDR1 (NVARCHAR(150))
  ADDR2 (NVARCHAR(150))
  EMAIL (NVARCHAR(200))
  PHONENO (NVARCHAR(200))
  CONTACTDATE (DATETIME)
  </code></pre>
  
  <p>According to the docs, I can use the FromSql method of a context model to call a stored procedure. But what if the stored procedure returns a schema having a only a few (if any) of the fields that match the model of the context from which the call is made?</p>
  
  <p>If I construct a Query such as:</p>
  
  <pre><code>var _ctx = new DbContext();
  var pkgs = _ctx.Prospects.FromSql("EXEC dbo.GetPackages").ToList();
  </code></pre>
  
  <p>This obviously will fail due the fact that returned recordset doesn't contain fields relevant to the Prospects model.</p>
  
  <p>Conversely, using something like:</p>
  
  <pre><code>var pkgs = _ctx.Database.ExecuteSqlCommand("EXEC dbo.GetPackages");
  </code></pre>
  
  <p>Is pointless as well because it will only return the number of records affected by the command execution.</p>
  
  <p>So the FromSql method available in .NET Core obviously has its set of limitations although it's documented as available for making stored procedure calls.</p>
  
  <p>Ideally, I'd like to see the Core Framework have the ability to make direct calls to Stored Procedures and Functions in much the same manner as is with EF within the .NET Framework and simplify things. But I realize that functionality isn't yet available in Core; though I hope it eventually does.</p>
  
  <p>Anyway, enough rambling and to the point.</p>
  
  <p>How or what currently is the most practical and widely accepted way to call a stored procedure under these set of circumstances in .NET Core? I know ADO.NET is an option but I'm speaking strictly within the paradigm of the Core Framework using EF</p>