私はスコープを作成し、ダイアログスタックをロードし、その間で中断し、中断したものを実行するプロアクティブなボットサンプルを理解しようとしています。 Dependency Injectionのスコープについて教えてください。私は 依存性注入に新しいとC#のAutofacです。Microsoft Bot Framework C#のDialogModule.BeginLifeTimeScopeとは何ですか?
1)DialogModule.BeginLifetimeScope(Conversation.Container
は何をしますか?
2)var stack = scope.Resolve<IDialogStack>();
は何をしますか?
3)await stack.PollAsync(CancellationToken.None);
は何をしますか?
4)await botData.FlushAsync(CancellationToken.None);
は何をしていますか?
// Create a scope that can be used to work with state from bot framework.
using (var scope = DialogModule.BeginLifetimeScope(Conversation.Container, message))
{
var botData = scope.Resolve<IBotData>();
await botData.LoadAsync(CancellationToken.None);
// This is the dialog stack.
var stack = scope.Resolve<IDialogStack>();
// Create the new dialog and add it to the stack.
var dialog =new SurveyDialog();
stack.Call(dialog.Void<object, IMessageActivity>(), null);
await stack.PollAsync(CancellationToken.None);
// Flush the dialog stack back to its state store.
await botData.FlushAsync(CancellationToken.None);
}
あなたは[this](https://autofac.readthedocs.io/en/latest/lifetime/index.html)を読んでいましたか? – Steven
私はこれを通過しましたが、それを得ていませんでした。私の4つの質問を説明してください。@Steven –
申し訳ありませんが、私はBotフレームワークに精通していません。 – Steven