Show / Hide Table of Contents

    Class DictionaryConverterExtensions

    This is an extension implementation of the DictionaryConverter class.

    Inheritance
    System.Object
    DictionaryConverterExtensions
    Namespace: Cuemon.Collections.Generic
    Assembly: Cuemon.Core.dll
    Syntax
    public static class DictionaryConverterExtensions

    Methods

    | Improve this Doc

    ToDictionary<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 source sequence.

    Type Parameters
    Name Description
    TKey

    The type of keys in the source.

    TValue

    The type of values in the source.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null.

    System.ArgumentException

    source contains at least one System.Collections.Generic.KeyValuePair<TKey,TValue> that produces duplicate keys for two elements.

    | Improve this Doc

    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 source sequence.

    Type Parameters
    Name Description
    TKey

    The type of keys in the source.

    TValue

    The type of values in the source.

    Exceptions
    Type Condition
    System.ArgumentNullException

    source is null - or - comparer is null.

    System.ArgumentException

    source contains at least one System.Collections.Generic.KeyValuePair<TKey,TValue> that produces duplicate keys for two elements.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX