ImmutableDictionary.GetValueOrDefault 메서드

정의

오버로드

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

일치하는 키가 사전에 있는 경우 지정된 키의 값을 가져옵니다.

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

일치하는 키가 사전에 있는 경우 지정된 키의 값을 가져옵니다.

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

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

일치하는 키가 사전에 있는 경우 지정된 키의 값을 가져옵니다.

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

일치하는 키가 사전에 없는 경우에 반환할 기본값입니다.

반환

TValue

키의 값입니다. 일치하는 키가 없는 경우 defaultValue입니다.

적용 대상

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

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

일치하는 키가 사전에 있는 경우 지정된 키의 값을 가져옵니다.

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

검색할 키입니다.

반환

TValue

키의 값입니다. 일치하는 키가 없는 경우 default(TValue)입니다.

적용 대상