ImmutableDictionary.GetValueOrDefault Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Överlagringar
| Name | Description |
|---|---|
| GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey) |
Hämtar värdet för en viss nyckel om det finns en matchande nyckel i ordlistan. |
| GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey, TValue) |
Hämtar värdet för en viss nyckel om det finns en matchande nyckel i ordlistan. |
GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey)
- Källa:
- ImmutableDictionary.cs
- Källa:
- ImmutableDictionary.cs
- Källa:
- ImmutableDictionary.cs
- Källa:
- ImmutableDictionary.cs
- Källa:
- ImmutableDictionary.cs
- Källa:
- ImmutableDictionary.cs
Hämtar värdet för en viss nyckel om det finns en matchande nyckel i ordlistan.
public:
generic <typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
static TValue GetValueOrDefault(System::Collections::Immutable::IImmutableDictionary<TKey, TValue> ^ dictionary, TKey key);
public static TValue GetValueOrDefault<TKey,TValue>(this System.Collections.Immutable.IImmutableDictionary<TKey,TValue> dictionary, TKey key);
public static TValue? GetValueOrDefault<TKey,TValue>(this System.Collections.Immutable.IImmutableDictionary<TKey,TValue> dictionary, TKey key);
static member GetValueOrDefault : System.Collections.Immutable.IImmutableDictionary<'Key, 'Value> * 'Key -> 'Value
<Extension()>
Public Function GetValueOrDefault(Of TKey, TValue) (dictionary As IImmutableDictionary(Of TKey, TValue), key As TKey) As TValue
Typparametrar
- TKey
Typ av nyckel.
- TValue
Typ av värde.
Parametrar
- dictionary
- IImmutableDictionary<TKey,TValue>
Ordlistan som du vill hämta värdet från.
- key
- TKey
Nyckeln att leta efter.
Returer
Värdet för nyckeln eller default(TValue) om ingen matchande nyckel hittades.
Gäller för
GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey, TValue)
- Källa:
- ImmutableDictionary.cs
- Källa:
- ImmutableDictionary.cs
- Källa:
- ImmutableDictionary.cs
- Källa:
- ImmutableDictionary.cs
- Källa:
- ImmutableDictionary.cs
- Källa:
- ImmutableDictionary.cs
Hämtar värdet för en viss nyckel om det finns en matchande nyckel i ordlistan.
public:
generic <typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
static TValue GetValueOrDefault(System::Collections::Immutable::IImmutableDictionary<TKey, TValue> ^ dictionary, TKey key, TValue defaultValue);
public static TValue GetValueOrDefault<TKey,TValue>(this System.Collections.Immutable.IImmutableDictionary<TKey,TValue> dictionary, TKey key, TValue defaultValue);
static member GetValueOrDefault : System.Collections.Immutable.IImmutableDictionary<'Key, 'Value> * 'Key * 'Value -> 'Value
<Extension()>
Public Function GetValueOrDefault(Of TKey, TValue) (dictionary As IImmutableDictionary(Of TKey, TValue), key As TKey, defaultValue As TValue) As TValue
Typparametrar
- TKey
Typ av nyckel.
- TValue
Typ av värde.
Parametrar
- dictionary
- IImmutableDictionary<TKey,TValue>
Ordlistan som du vill hämta värdet från.
- key
- TKey
Nyckeln att leta efter.
- defaultValue
- TValue
Standardvärdet som ska returneras om ingen matchande nyckel hittas i ordlistan.
Returer
Värdet för nyckeln eller defaultValue om ingen matchande nyckel hittades.