Class DictionaryExtensions
- Namespace
- WindowSill.API
- Assembly
- WindowSill.API.dll
Provides extension methods for dictionaries.
public static class DictionaryExtensions
- Inheritance
-
DictionaryExtensions
- Inherited Members
Methods
GetValueOrDefault<TKey, TValue>(IDictionary<TKey, TValue>, TKey)
Gets the value at the given key, or a default value.
public static TValue? GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
Parameters
dictionaryIDictionary<TKey, TValue>The dictionary to retrieve the value from.
keyTKeyThe key to retrieve the value for.
Returns
- TValue
The value associated with the specified key, or the default value if the key is not found.
Type Parameters
TKeyThe type of the keys in the dictionary.
TValueThe type of the values in the dictionary.