<p>What's the best way to merge 2 or more dictionaries (<code>Dictionary&lt;T1,T2&gt;</code>) in C#?
(3.0 features like LINQ are fine).</p>

<p>I'm thinking of a method signature along the lines of:</p>

<pre><code>public static Dictionary&lt;TKey,TValue&gt;
                 Merge&lt;TKey,TValue&gt;(Dictionary&lt;TKey,TValue&gt;[] dictionaries);
</code></pre>

<p>or</p>

<pre><code>public static Dictionary&lt;TKey,TValue&gt;
                 Merge&lt;TKey,TValue&gt;(IEnumerable&lt;Dictionary&lt;TKey,TValue&gt;&gt; dictionaries);
</code></pre>

<p><strong>EDIT:</strong> Got a cool solution from JaredPar and Jon Skeet, but I was thinking of something that handles duplicate keys. In case of collision, it doesn't matter which value is saved to the dict as long as it's consistent.</p>

The trivial solution would be:
```
```
using System.Collections.Generic;
...
public static Dictionary<TKey, TValue>
    Merge<TKey,TValue>(IEnumerable<Dictionary<TKey, TValue>> dictionaries)
{
    var result = new Dictionary<TKey, TValue>();
    foreach (var dict in dictionaries)
        foreach (var x in dict)
            result[x.Key] = x.Value;
    return result;
}
```
```