title: Automatically creating a collection in the Dictionary<Key, Collection<Value>>
body: <p>Lot of times I have to create a <code>Dictionary&lt;KeyType, List&lt;ValueType&gt;&gt;</code></p>
  
  <p>Before I can start using the dictionary I have to first verify that List has been created for that key.</p>
  
  <pre><code>//Can i remove these two lines?
  if(!dict.ContainsKey(key)) 
      dict[key]= new List&lt;ValueType&gt;;
  
  //now use the key
  dict[key].Add(value);
  </code></pre>
  
  <p>I know its only "2 lines" of code but it annoys me and I think it can be removed.</p>
  
  <p>I can extend dictionary in someway but before I do it, I want to know if someone has found a clever way to remove the above <code>if</code> statement.</p>
  
  <p>Basically i want to create a <code>Dictionary&lt;KeyType, Collection&lt;ValueType&gt;&gt;</code> and start using it right away like <code>dict[key].Add(value)</code>.</p>