Table of Contents

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

source IDictionary<TKey, TValue>

The dictionary to merge to.

dictionary IDictionary<TKey, TValue>

The IDictionary<TKey, TValue> to merge from.

Type Parameters

TKey

The element type of the key.

TValue

The 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

source IDictionary<TKey, TValue>

The dictionary to merge with.

dictionary IReadOnlyDictionary<TKey, TValue>

The IReadOnlyDictionary<TKey, TValue> to merge from.

Type Parameters

TKey

The element type of the key.

TValue

The element type of the value.

Remarks

Elements with a key that already exists will not be merged.