Example #1
0
        private async Task <DialogTurnResult> AddToCartStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            if ((bool)stepContext.Result)
            {
                var orderLine = stepContext.GetValue <OrderLine>(ORDER);
                await PurchaseController.AddOrderLineToUser(stepContext.Context.Activity.From.Id, orderLine);

                await stepContext.Context.SendActivityAsync(MessageFactory.Text(addedMsg), cancellationToken);
            }
            else
            {
                await stepContext.Context.SendActivityAsync(MessageFactory.Text(notAddedMsg), cancellationToken);
            }

            return(await stepContext.EndDialogAsync((bool)stepContext.Result, cancellationToken));
        }