DictionaryExtensions.GetOrDefault<TK,TV> 메서드

정의

지정된 키로 값을 가져옵니다.

public:
generic <typename TK, typename TV>
[System::Runtime::CompilerServices::Extension]
 static TV GetOrDefault(System::Collections::Generic::IDictionary<TK, TV> ^ dictionary, TK key);
public static TV GetOrDefault<TK,TV> (this System.Collections.Generic.IDictionary<TK,TV> dictionary, TK key);
static member GetOrDefault : System.Collections.Generic.IDictionary<'K, 'V> * 'K -> 'V
<Extension()>
Public Function GetOrDefault(Of TK, TV) (dictionary As IDictionary(Of TK, TV), key As TK) As TV

형식 매개 변수

TK

키 유형

TV

값 형식(value type)

매개 변수

dictionary
IDictionary<TK,TV>

사전

key
TK

사전의 키

반환

TV

기본값으로, 사전에 키가 없으면 입니다.

적용 대상