DictionaryExtensions Class

Summary

Extension methods for IDictionary<TKey, TValue>.
Namespace
StrideToolkit.Collections
Base Types
  • object
graph BT Type-->Base0["object"] Type["DictionaryExtensions"] class Type type-node

Syntax

public static class DictionaryExtensions

Methods

Name Value Summary
GetOrAdd<TKey, TValue>(IDictionary<TKey, TValue>, TKey, Func<TKey, TValue>) TValue
Gets the element with the specified key or adds it if it is not in the dictionary.
static
GetOrAdd<TKey, TValue>(IDictionary<TKey, TValue>, TKey, Func<TKey, TValue>, Func<TValue, bool>) TValue
Gets the element with the specified key in the dictionary or the new value returned from the getValue callback. If the shouldAdd callback returns then the new value is added to the dictionary.
static
GetOrDefault<TKey, TValue>(IDictionary<TKey, TValue>, TKey, TValue) TValue
Gets the element with the specified key or a default value if it is not in the dictionary.
static
Increment<TKey>(IDictionary<TKey, int>, TKey) int
Increments integer value in a dictionary by 1.
static
MergeInto<TKey, TValue>(IDictionary<TKey, TValue>, IDictionary<TKey, TValue>) void
Adds items from one dictionary to the other.
static