Class DictionaryExtensions
Extension helpers for IDictionary<TKey, TValue> to simplify common lookups without exceptions.
Inheritance
Inherited Members
Namespace: System.Collections.Generic
Assembly: Telerik.Windows.Documents.Core.dll
Syntax
public static class DictionaryExtensions
Methods
GetValueOrNull<TKey, TValue>(IDictionary<TKey, TValue>, TKey)
Return the value for key, or null if absent, avoiding exceptions for missing keys.
Declaration
public static TValue GetValueOrNull<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
where TValue : class
Parameters
|
System.Collections.Generic.IDictionary<TKey, TValue>
dictionary
The dictionary. |
|
TKey
key
The key. |
Returns
|
TValue
The value associated with the specified key, or |
Type Parameters
|
TKey
The type of the T key. |
|
TValue
The type of the T value. |