Show / Hide Table of Contents

    Class DictionaryConverter

    This utility class is designed to make System.Collections.Generic.IDictionary<TKey, TValue> related conversions easier to work with.

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

    Methods

    | Improve this Doc

    FromEnumerable<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> FromEnumerable<TKey, TValue>(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

    FromEnumerable<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> FromEnumerable<TKey, TValue>(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