状態をAzure Table Storeで管理するようにMBFボットを更新しています。私たちは、表ストアプロバイダを登録するためのマニュアルに従ってコードを変更:今すぐMicrosoft Bot Framework State Management
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
var builder = new ContainerBuilder();
var store = new TableBotDataStore("...");
builder.Register(c => store)
.Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
.AsSelf()
.SingleInstance();
builder.Register(c => new CachingBotDataStore(store,
CachingBotDataStoreConsistencyPolicy
.ETagBasedConsistency))
.As<IBotDataStore<BotData>>()
.AsSelf()
.InstancePerLifetimeScope();
var config = GlobalConfiguration.Configuration;
var container = builder.Build();
config.DependencyResolver = new AutofacWebApiDependencyResolver(container);
}
、私たちは保存するために、次のとロードユーザデータを使用するダイアログで:
context.PrivateConversationData.SetValue<UserData>(UserDataRepositoryKey, userData);
興味深いのは、対話状態がいるようだということです私たちはAzureテーブルは何もないと私は確信しています。ドキュメントは、正しい方法で状態を使用する方法について非常に不明です。
質問:
は、当社のコンテナの登録が正しく見えるのか?それはapp_startにあるべきか、それとも毎回のリクエストに対して登録するべきですか?
会話中に状態を保存する正しい方法を使用していますか?
ありがとうございました! – Alekos