ImmutableDictionary.GetValueOrDefault Método

Definição

Sobrecargas

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

Obtém o valor de uma determinada chave, se uma chave correspondente existir no dicionário.

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

Obtém o valor de uma determinada chave, se uma chave correspondente existir no dicionário.

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

Origem:
ImmutableDictionary.cs
Origem:
ImmutableDictionary.cs
Origem:
ImmutableDictionary.cs

Obtém o valor de uma determinada chave, se uma chave correspondente existir no dicionário.

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

Parâmetros de tipo

TKey

Tipo da chave.

TValue

O tipo do valor.

Parâmetros

dictionary
IImmutableDictionary<TKey,TValue>

O dicionário do qual recuperar o valor.

key
TKey

A chave a ser pesquisada.

defaultValue
TValue

O valor padrão a ser retornado se nenhuma chave correspondente for encontrada no dicionário.

Retornos

TValue

O valor da chave ou defaultValue se nenhuma chave correspondente for encontrada.

Aplica-se a

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

Origem:
ImmutableDictionary.cs
Origem:
ImmutableDictionary.cs
Origem:
ImmutableDictionary.cs

Obtém o valor de uma determinada chave, se uma chave correspondente existir no dicionário.

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

Parâmetros de tipo

TKey

Tipo da chave.

TValue

Tipo do valor.

Parâmetros

dictionary
IImmutableDictionary<TKey,TValue>

O dicionário do qual recuperar o valor.

key
TKey

A chave a ser pesquisada.

Retornos

TValue

O valor da chave ou default(TValue) se nenhuma chave correspondente for encontrada.

Aplica-se a