ImmutableDictionary.GetValueOrDefault Metodo

Definizione

Overload

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

Ottiene il valore per una determinata chiave se esiste una chiave corrispondente nel dizionario.

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

Ottiene il valore per una determinata chiave se esiste una chiave corrispondente nel dizionario.

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

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

Ottiene il valore per una determinata chiave se esiste una chiave corrispondente nel dizionario.

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

Parametri di tipo

TKey

Tipo di chiave.

TValue

Tipo del valore.

Parametri

dictionary
IImmutableDictionary<TKey,TValue>

Dizionario da cui recuperare il valore.

key
TKey

Chiave da ricercare.

defaultValue
TValue

Valore predefinito da restituire se non viene trovata alcuna chiave corrispondente nel dizionario.

Restituisce

TValue

Valore della chiave oppure defaultValue se non è stata trovata alcuna chiave corrispondente.

Si applica a

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

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

Ottiene il valore per una determinata chiave se esiste una chiave corrispondente nel dizionario.

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

Parametri di tipo

TKey

Tipo di chiave.

TValue

Tipo di valore.

Parametri

dictionary
IImmutableDictionary<TKey,TValue>

Dizionario da cui recuperare il valore.

key
TKey

Chiave da ricercare.

Restituisce

TValue

Valore della chiave oppure default(TValue) se non è stata trovata alcuna chiave corrispondente.

Si applica a