Exemplo n.º 1
0
        private async Task <DialogTurnResult> FinalStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            var nodeActual = stepContext.GetValue <NodeDecisio>("Node");

            if (nodeActual.fills.Count == 0)
            {
                var question = (string)stepContext.Result;

                await QuestionController.AddQuestionAsync(question, stepContext.Context.Activity.From.Id);

                return(await stepContext.EndDialogAsync(cancellationToken : cancellationToken));
            }
            else
            {
                var choice = (FoundChoice)stepContext.Result;
                return(await stepContext.ReplaceDialogAsync(nameof(TechnicalAssistanceDialog), nodeActual.ObtenirNode(choice.Value), cancellationToken));
            }
        }