Class DictionaryExtensions
- Namespace
- Visus.AddressValidation.Extensions
- Assembly
- Visus.AddressValidation.dll
Contains extension methods for IDictionary<TKey, TValue> and IReadOnlyDictionary<TKey, TValue> instances.
public static class DictionaryExtensions
- Inheritance
-
DictionaryExtensions
- Inherited Members
Methods
Merge<TKey, TValue>(IDictionary<TKey, TValue>, IDictionary<TKey, TValue>)
Merges the elements from dictionary with the source.
public static void Merge<TKey, TValue>(this IDictionary<TKey, TValue> source, IDictionary<TKey, TValue> dictionary) where TKey : notnull
Parameters
sourceIDictionary<TKey, TValue>The dictionary to merge to.
dictionaryIDictionary<TKey, TValue>The IDictionary<TKey, TValue> to merge from.
Type Parameters
TKeyThe element type of the key.
TValueThe element type of the value.
Remarks
Elements with a key that already exists will not be merged.
Merge<TKey, TValue>(IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>)
Merges the elements from dictionary with the source.
public static void Merge<TKey, TValue>(this IDictionary<TKey, TValue> source, IReadOnlyDictionary<TKey, TValue> dictionary) where TKey : notnull
Parameters
sourceIDictionary<TKey, TValue>The dictionary to merge with.
dictionaryIReadOnlyDictionary<TKey, TValue>The IReadOnlyDictionary<TKey, TValue> to merge from.
Type Parameters
TKeyThe element type of the key.
TValueThe element type of the value.
Remarks
Elements with a key that already exists will not be merged.