Class DictionaryConverterExtensions
This is an extension implementation of the DictionaryConverter class.
Inheritance
Namespace: Cuemon.Collections.Generic
Assembly: Cuemon.Core.dll
Syntax
public static class DictionaryConverterExtensions
Methods
| Improve this DocToDictionary<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>>)
Creates a System.Collections.Generic.Dictionary<TKey, TValue> from the specified source
sequence.
Declaration
public static IDictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>> | source | The sequence to create a System.Collections.Generic.Dictionary<TKey, TValue> from. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<TKey, TValue> | A System.Collections.Generic.Dictionary<TKey, TValue> that is equivalent to the specified |
Type Parameters
Name | Description |
---|---|
TKey | The type of keys in the |
TValue | The type of values in the |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentException |
|
ToDictionary<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>>, IEqualityComparer<TKey>)
Creates a System.Collections.Generic.Dictionary<TKey, TValue> from the specified source
sequence.
Declaration
public static IDictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey> comparer)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>> | source | The sequence to create a System.Collections.Generic.Dictionary<TKey, TValue> from. |
System.Collections.Generic.IEqualityComparer<TKey> | comparer | The System.Collections.Generic.IEqualityComparer<T> implementation to use when comparing keys. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<TKey, TValue> | A System.Collections.Generic.Dictionary<TKey, TValue> that is equivalent to the specified |
Type Parameters
Name | Description |
---|---|
TKey | The type of keys in the |
TValue | The type of values in the |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentException |
|