DictionaryExtensionMethods.AddRange<TKey, TValue> Method |
Adds the range specified to the dictionary specified, using the key producer func to produce the key values.
If the key already exists, the key's value is overwritten with the value to add.
Namespace:
SD.Tools.BCLExtensions.CollectionsRelated
Assembly:
SD.Tools.BCLExtensions (in SD.Tools.BCLExtensions.dll) Version: 1.1.1
Syntaxpublic static void AddRange<TKey, TValue>(
this Dictionary<TKey, TValue> container,
Func<TValue, TKey> keyProducerFunc,
IEnumerable<TValue> rangeToAdd
)
<ExtensionAttribute>
Public Shared Sub AddRange(Of TKey, TValue) (
container As Dictionary(Of TKey, TValue),
keyProducerFunc As Func(Of TValue, TKey),
rangeToAdd As IEnumerable(Of TValue)
)
Parameters
- container
- Type: System.Collections.Generic.Dictionary<TKey, TValue>
The container. - keyProducerFunc
- Type: System.Func<TValue, TKey>
The key producer func. - rangeToAdd
- Type: System.Collections.Generic.IEnumerable<TValue>
The range to add.
Type Parameters
- TKey
- The type of the key.
- TValue
- The type of the value.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Dictionary<TKey,
TValue>. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also