This project is read-only.

Dictionary Extension Methods

The following extension methods are defined for the Dictionary<TKey, TValue> type:

  • void AddRange<TKey, TValue>(Func<TValue, TKey> keyProducerFunc, IEnumerable<TValue> rangeToAdd).
    Adds the range rangeToAdd to the dictionary specified, using the Func keyProducerFunc to produce the key values. If the key already exists, the key's value is overwritten with the value to add.
  • TValue GetValue<TKey, TValue>(TKey key).
    Gets the value for the key from the dictionary specified, or null / default(TValue) if key not found or the key is null.

Last edited Nov 27, 2010 at 1:28 PM by SolutionsDesign, version 5


PauloMorgado Dec 5, 2010 at 6:24 PM 
I agree with mihailik. It should also have an overload to provide what the delaut is for that call.

mihailik Nov 29, 2010 at 11:38 AM 
GetValue should be GetValueOrDefault to follow existing BCL pattern.