title: EF: How to execute a SQL-query with multiple joins?
body: <p>Im working with Entity Framework version 6.1.3 and I want to execute a SQL-query
  which gathers information from multiple tables like this:</p>
  
  <pre><code>var result = context.Database.SqlQuery&lt;SomeType&gt;("SELECT SUM(d.PurchaseValue) AS 'Total', div.Name, l.Name " +
                                                    "FROM Device AS d " +
                                                    "RIGHT JOIN Location AS l " +
                                                    "ON d.LOCATION_ID = l.ID " +
                                                    "RIGHT JOIN Division AS div " +
                                                    "ON d.DIVISION_ID = div.ID " +
                                                    "GROUP BY div.Name, l.Name " +
                                                    "ORDER BY l.Name");
  </code></pre>
  
  <p>My question is, what should be the the type in SqlQuery&lt;>? Or what is the proper way to execute a query like this and get a result out of it?</p>