Пример #1
0
        private async Task <DialogTurnResult> IntroStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            await stepContext.Context.SendActivityAsync(MessageFactory.Text($"you said '{stepContext.Context.Activity.Text}'"), cancellationToken);

            await stepContext.Context.SendActivityAsync(MessageFactory.Text($"starting long running workload, result will be arriving soon..."), cancellationToken);

            var options = new QueuedWorkloadDialog.Options {
                RequestUri = BackendWebAddress, Json = "{\"message\":\"hello once\"}"
            };

            return(await stepContext.BeginDialogAsync(nameof(QueuedWorkloadDialog), options, cancellationToken));
        }
Пример #2
0
        private async Task <DialogTurnResult> ActStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            var obj = (JObject)stepContext.Result;
            await stepContext.Context.SendActivityAsync(MessageFactory.Text($"here are the results '{obj["reply"]}'"), cancellationToken);

            await stepContext.Context.SendActivityAsync(MessageFactory.Text($"again starting long running workload, more result will be arriving soon..."), cancellationToken);

            var options = new QueuedWorkloadDialog.Options {
                RequestUri = BackendWebAddress, Json = "{\"message\":\"hello twice\"}"
            };

            return(await stepContext.BeginDialogAsync(nameof(QueuedWorkloadDialog), options, cancellationToken));
        }