Extensions.GetValueOrDefault<T>(IBotDataBag, String, T) 메서드

정의

지정한 키와 연결된 값을 가져오거나, 찾을 수 없는 경우 기본값을 가져옵니다.

public static T GetValueOrDefault<T> (this Microsoft.Bot.Builder.Dialogs.IBotDataBag bag, string key, T defaultValue = default);
static member GetValueOrDefault : Microsoft.Bot.Builder.Dialogs.IBotDataBag * string * 'T -> 'T
<Extension()>
Public Function GetValueOrDefault(Of T) (bag As IBotDataBag, key As String, Optional defaultValue As T = Nothing) As T

형식 매개 변수

T

가져올 값의 형식입니다.

매개 변수

bag
IBotDataBag

봇 데이터 모음입니다.

key
String

가져오거나 설정할 값의 키입니다.

defaultValue
T

키가 없는 경우 반환할 값입니다.

반환

T

지정한 키와 연결된 값입니다. 지정된 키를 찾을 수 defaultValue 없으면 가 반환됩니다.

적용 대상