CollectionExtensionsGetOrDefaultTKey, TValue(IDictionaryTKey, TValue, TKey) Method
Attempts to get the value for the given key and returns the default value instead if the key does not exist in the
IDictionaryTKey, TValue.
Namespace: Gemstone.Collections.CollectionExtensionsAssembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.110 -- Release Build+3e0464f4461df4d3e1175b13966eb47ff832554d
public static TValue GetOrDefault<TKey, TValue>(
this IDictionary<TKey, TValue> dictionary,
TKey key
)
public:
[ExtensionAttribute]
generic<typename TKey, typename TValue>
static TValue GetOrDefault(
IDictionary<TKey, TValue>^ dictionary,
TKey key
)
JavaScript does not support generic types or methods.
- dictionary IDictionaryTKey, TValue
- The dictionary to check for the given key.
- key TKey
- The key to be checked for the existence of a value.
- TKey
- The type of the keys in the dictionary.
- TValue
- The type of the values in the dictionary.
TValueThe value of the key in the dictionary or the default value if no such value exists.In Visual Basic and C#, you can call this method as an instance method on any object of type
IDictionaryTKey,
TValue. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).