Share via


BotState(IStorage, String) Constructor

Definition

Initializes a new instance of the BotState class.

public BotState (Microsoft.Bot.Builder.IStorage storage, string contextServiceKey);
new Microsoft.Bot.Builder.BotState : Microsoft.Bot.Builder.IStorage * string -> Microsoft.Bot.Builder.BotState
Public Sub New (storage As IStorage, contextServiceKey As String)

Parameters

storage
IStorage

The storage layer this state management object will use to store and retrieve state.

contextServiceKey
String

The key for the state cache for this BotState.

Exceptions

storage or contextServiceKey is null.

Remarks

This constructor creates a state management object and associated scope. The object uses storage to persist state property values. The object uses the contextServiceKey to cache state within the context for each turn.

Applies to

See also