ImmutableDictionary.GetValueOrDefault メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
| 名前 | 説明 |
|---|---|
| GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey) |
ディクショナリに一致するキーが存在する場合は、特定のキーの値を取得します。 |
| GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey, TValue) |
ディクショナリに一致するキーが存在する場合は、特定のキーの値を取得します。 |
GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey)
ディクショナリに一致するキーが存在する場合は、特定のキーの値を取得します。
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
型パラメーター
- TKey
キーの型。
- TValue
値の型。
パラメーター
- dictionary
- IImmutableDictionary<TKey,TValue>
値を取得するディクショナリ。
- key
- TKey
検索用のキー。
返品
キーの値。一致するキーが見つからなかった場合は default(TValue) 。
適用対象
GetValueOrDefault<TKey,TValue>(IImmutableDictionary<TKey,TValue>, TKey, TValue)
ディクショナリに一致するキーが存在する場合は、特定のキーの値を取得します。
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
型パラメーター
- TKey
キーの型。
- TValue
値の型。
パラメーター
- dictionary
- IImmutableDictionary<TKey,TValue>
値を取得するディクショナリ。
- key
- TKey
検索用のキー。
- defaultValue
- TValue
ディクショナリに一致するキーが見つからない場合に返される既定値。
返品
キーの値。一致するキーが見つからなかった場合は defaultValue 。