Extensions.GetValueOrDefault<T>(IBotDataBag, String, T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the value associated with the specified key or a default value if not found.
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
Type Parameters
- T
The type of the value to get.
Parameters
- bag
- IBotDataBag
The bot data bag.
- key
- String
The key of the value to get or set.
- defaultValue
- T
The value to return if the key is not present
Returns
T
The value associated with the specified key. If the specified key is not found, defaultValue
is returned