title: .net dictionary and lookup add / update
body: <p>I am sick of doing blocks of code like this for various bits of code I have:</p>
  
  <pre><code>if (dict.ContainsKey[key]) {  
      dict[key] = value;  
  }  
  else {  
      dict.Add(key,value);  
  }
  </code></pre>
  
  <p>and for lookups (i.e. key -> list of value)</p>
  
  <pre><code>if (lookup.ContainsKey[key]) {  
      lookup[key].Add(value);  
  }  
  else {  
      lookup.Add(new List&lt;valuetype&gt;);  
      lookup[key].Add(value);  
  }  
  </code></pre>
  
  <p>Is there another collections lib or extension method I should use to do this in one line of code no matter what the key and value types are?</p>
  
  <p>e.g.</p>
  
  <pre><code>dict.AddOrUpdate(key,value)  
  lookup.AddOrUpdate(key,value)
  </code></pre>