• ASP.NET Core API
  • Core API
  • Mail API
  • Json API
  • Core API

    Show / Hide Table of Contents

    Class DictionaryUtility

    This utility class provides a set of concrete static methods for supporting the EnumerableUtility.

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

    Methods

    | Improve this Doc

    FirstMatchOrDefault<TKey, TValue>(IDictionary<TKey, TValue>, TKey[])

    Returns the first TValue matching one of the specified keys in a System.Collections.Generic.IDictionary<TKey, TValue>, or a default value if the source contains no elements or no match was found.

    Declaration
    public static TValue FirstMatchOrDefault<TKey, TValue>(IDictionary<TKey, TValue> source, params TKey[] keys)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<TKey, TValue> source

    The System.Collections.Generic.IDictionary<TKey, TValue> to return a matching TValue from.

    TKey[] keys

    A variable number of keys to match in the specified source.

    Returns
    Type Description
    TValue

    default(TValue) if source is empty or no match was found; otherwise, the matching element in source.

    Type Parameters
    Name Description
    TKey

    The System.Type of the key.

    TValue

    The System.Type of the value.

    Remarks

    The default value for reference and nullable types is null.

    | Improve this Doc

    FirstMatchOrDefault<TKey, TValue>(IDictionary<TKey, TValue>, TValue, TKey[])

    Returns the first TValue matching one of the specified keys in a System.Collections.Generic.IDictionary<TKey, TValue>, or a defaultValue if the source contains no elements or no match was found.

    Declaration
    public static TValue FirstMatchOrDefault<TKey, TValue>(IDictionary<TKey, TValue> source, TValue defaultValue, params TKey[] keys)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<TKey, TValue> source

    The System.Collections.Generic.IDictionary<TKey, TValue> to return a matching TValue from.

    TValue defaultValue

    The default value to return when source contains no elements or no match was found.

    TKey[] keys

    A variable number of keys to match in the specified source.

    Returns
    Type Description
    TValue

    defaultValue if source is empty or no match was found; otherwise, the matching element in source.

    Type Parameters
    Name Description
    TKey

    The System.Type of the key.

    TValue

    The System.Type of the value.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • FirstMatchOrDefault<TKey, TValue>(IDictionary<TKey, TValue>, TKey[])
      • FirstMatchOrDefault<TKey, TValue>(IDictionary<TKey, TValue>, TValue, TKey[])
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX