public static Dictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> enumeration) { // Check to see that enumeration is not null if (enumeration == null) throw new ArgumentNullException("enumeration"); return enumeration.ToDictionary(item => item.Key, item => item.Value); }
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.