Q:

How to convert IEnumerable of KeyValuePair to Dictionary?

Is there streamlined way to convert list/enumberable of KeyValuePair<T, U> to Dictionary<T, U>?
Linq transformation, .ToDictionary() extension did not work.

A:

.ToDictionary(kvp=>kvp.Key,kvp=>kvp.Value);

Isn't that much more work.

A:

You can create your own extension method that would perform as you expect.
public static class KeyValuePairEnumerableExtensions
{
    public static Dictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source)
    {
        return source.ToDictionary(item => item.Key, item => item.Value);
    }
}

