title: List to Dictionary<Key, List<Value>> - C#
body: <p>I have a List and MyClass is:</p>
  
  <pre><code>public class MyClass
  {
      public bool Selected { get; set; }
      public Guid NoticeID { get; set; }
      public Guid TypeID { get; set; }
  }
  </code></pre>
  
  <p>My question is, how do i convert this list into a <code>Dictionary&lt;Guid, List&lt;Guid&gt;&gt;</code>, where the dictionary key is the GUID from the <code>TypeID</code> property, and the value is a list of all the <code>NoticeID</code> values corresponding to that <code>TypeID</code>. I have tried like so:</p>
  
  <pre><code>list.GroupBy(p =&gt; p.TypeID).ToDictionary(p =&gt; p.Key, p =&gt; p.ToList())
  </code></pre>
  
  <p>but this returns a <code>Dictionary &lt;Guid, List&lt;MyClass&gt;&gt;</code>, and I want a <code>Dictionary&lt;Guid, List&lt;Guid&gt;&gt;</code>.</p>