title: LINQ - Convert List to Dictionary with Value as List
body: <p>I have a </p>
  
  <pre><code>List&lt;MyObject&gt; 
  </code></pre>
  
  <p>that I retrieve from the database. However, I would like it keyed by a property in MyObject for grouping purposes. What is the best way with LINQ to cast my list to:</p>
  
  <pre><code>Dictionary&lt;long, List&lt;MyObject&gt;&gt;
  </code></pre>
  
  <p>I have the following:</p>
  
  <pre><code>myObjectList.ToDictionary(x =&gt; x.KeyedProperty)
  </code></pre>
  
  <p>But it returns:</p>
  
  <pre><code>Dictionary&lt;long, MyObject&gt;
  </code></pre>