title: Using SqlQuery<Dictionary<string, string>> in Entity Framework 6
body: <p>I'm trying to execute a SQL query in EF 6. The <code>select</code> query returns two string columns, e.g. <code>select 'a', 'b'</code>, and can have any number of rows.</p>
  
  <p>I'd like to map the result to a dictionary, but I can't get ride of the following error.</p>
  
  <blockquote>
    <p>Error  1   Cannot implicitly convert type 'System.Data.Entity.Infrastructure.DbRawSqlQuery>' to 'System.Collections.Generic.Dictionary'</p>
  </blockquote>
  
  <p>This is the code:</p>
  
  <pre><code>using (var db = new EFDbContext())
  {
      Dictionary&lt;string, string&gt; perms = new Dictionary&lt;string, string&gt;();
      perms = db.Database.SqlQuery&lt;Dictionary&lt;string, string&gt;&gt;(TheQuery);
  }
  </code></pre>
  
  <p>I've tried various <code>select</code> and <code>ToDictionary</code> after the query, but none of them worked.</p>