ImmutableDictionary<TKey,TValue>.Builder.GetValueOrDefault Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Sobrecargas
| Nome | Description |
|---|---|
| GetValueOrDefault(TKey, TValue) |
Obtém o valor de uma determinada chave se houver uma chave correspondente no dicionário. |
| GetValueOrDefault(TKey) |
Obtém o valor de uma determinada chave se houver uma chave correspondente no dicionário. |
GetValueOrDefault(TKey, TValue)
Obtém o valor de uma determinada chave se houver uma chave correspondente no dicionário.
public:
TValue GetValueOrDefault(TKey key, TValue defaultValue);
public TValue GetValueOrDefault(TKey key, TValue defaultValue);
member this.GetValueOrDefault : 'Key * 'Value -> 'Value
Public Function GetValueOrDefault (key As TKey, defaultValue As TValue) As TValue
Parâmetros
- key
- TKey
A chave de pesquisa.
- defaultValue
- TValue
O valor padrão a ser retornado se nenhuma chave correspondente for encontrada no dicionário.
Retornos
O valor da chave ou defaultValue se nenhuma chave correspondente foi encontrada.
Aplica-se a
GetValueOrDefault(TKey)
Obtém o valor de uma determinada chave se houver uma chave correspondente no dicionário.
public:
TValue GetValueOrDefault(TKey key);
public TValue GetValueOrDefault(TKey key);
public TValue? GetValueOrDefault(TKey key);
member this.GetValueOrDefault : 'Key -> 'Value
Public Function GetValueOrDefault (key As TKey) As TValue
Parâmetros
- key
- TKey
A chave de pesquisa.
Retornos
O valor da chave ou default(TValue) se nenhuma chave correspondente foi encontrada.