ImmutableDictionary.GetValueOrDefault Yöntem

Tanım

Aşırı Yüklemeler

GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey, TValue)

Sözlükte eşleşen bir anahtar varsa, belirli bir anahtarın değerini alır.

GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey)

Sözlükte eşleşen bir anahtar varsa, belirli bir anahtarın değerini alır.

GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey, TValue)

Source:
ImmutableDictionary.cs
Source:
ImmutableDictionary.cs
Source:
ImmutableDictionary.cs

Sözlükte eşleşen bir anahtar varsa, belirli bir anahtarın değerini alır.

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

Tür Parametreleri

TKey

Anahtarın türü.

TValue

Değerin türü.

Parametreler

dictionary
IImmutableDictionary<TKey,TValue>

Değerinin alın olduğu sözlük.

key
TKey

Aranacak anahtar.

defaultValue
TValue

Sözlükte eşleşen anahtar bulunmazsa döndürülecek varsayılan değer.

Döndürülenler

TValue

Anahtarın değeri veya defaultValue eşleşen anahtar bulunamadı.

Şunlara uygulanır

GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey)

Source:
ImmutableDictionary.cs
Source:
ImmutableDictionary.cs
Source:
ImmutableDictionary.cs

Sözlükte eşleşen bir anahtar varsa, belirli bir anahtarın değerini alır.

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

Tür Parametreleri

TKey

Anahtarın türü.

TValue

Değerin türü.

Parametreler

dictionary
IImmutableDictionary<TKey,TValue>

Değerinin alın olduğu sözlük.

key
TKey

Aranacak anahtar.

Döndürülenler

TValue

Anahtarın değeri veya default(TValue) eşleşen anahtar bulunamadı.

Şunlara uygulanır