title: Entity framework Core Raw SQLQueries with custom model
body: <p>Using Entity Framework 6, I was able to use execute a Raw SQL Query and use a custom model which was not defined in the DBContext in order to store the output of the query. A simple example is the following:</p>
  
  <pre><code>List&lt;MyModel&gt; data = context.Database.SqlQuery&lt;MyModel&gt;("SELECT Orders.OrderID, Customers.CustomerName FROM Orders INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID;").ToList();
  </code></pre>
  
  <p>I execute one SQL command and I expect a list of custom models.</p>
  
  <p>I try to do something similar with Entity Framework Core and the closest example that I found will force me to define a property from DBContext. This will not allow me to use a custom model to fill the data that SQL server will return.</p>
  
  <pre><code>var books = context.Books.FromSql("SELECT * FROM Books").ToList();
  </code></pre>
  
  <p>This query informs Entity Framework Core that the query will return a list of books. Is there a way to implement something like this in Entity Framework Core?</p>