语言

BotState(IStorage, String) 构造函数

定义

初始化 BotState 类的新实例。

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)

参数

storage
IStorage

该状态管理对象将使用该存储层来存储和检索状态。

contextServiceKey
String

该键是状态缓存的 BotState。

例外

storage 或 contextServiceKey 为 null.

注解

此构造函数创建状态管理对象和关联的范围。 该对象使用 storage 来持久化状态属性值。 该对象在上下文中每回合使用 contextServiceKey to 缓存状态。

适用于

另请参阅