DictionaryExtensions.GetOrDefault<TK,TV> Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value by the given key.
C++
public:
generic <typename TK, typename TV>
[System::Runtime::CompilerServices::Extension]
static TV GetOrDefault(System::Collections::Generic::IDictionary<TK, TV> ^ dictionary, TK key);
public static TV GetOrDefault<TK,TV>(this System.Collections.Generic.IDictionary<TK,TV> dictionary, TK key);
static member GetOrDefault : System.Collections.Generic.IDictionary<'K, 'V> * 'K -> 'V
<Extension()>
Public Function GetOrDefault(Of TK, TV) (dictionary As IDictionary(Of TK, TV), key As TK) As TV
- TK
key type
- TV
value type
- dictionary
- IDictionary<TK,TV>
dictionary
- key
- TK
key in the dictionary
TV
default if key doesn't exist in the dictionary.
Produkt | Verzie |
---|---|
Visual Studio SDK | 2019, 2022 |