Пример #1
0
        private static async Task RemoveProductsReceived(IDialogContext context, IMessageActivity message)
        {
            var removed = ProductRemover.Of(message.Value).Remove(context);
            await context.PostAsync(removed.Any()?
                                    "Items removed from basket: \n\n* " + string.Join(" \n\n* ", removed) :
                                        "No products removed");

            context.Done(new MessageBag <Product>(null, MessageType.ProductRemoval));
        }
Пример #2
0
        private async Task RemoveProductMessageRecievedAsync(IDialogContext context, IAwaitable <IMessageActivity> result)
        {
            var message = await result;
            var removed = ProductRemover.Of(message.Value).Remove(context);
            await context.PostAsync(removed.Any()?
                                    "Items removed from basket: \n\n* " + string.Join(" \n\n* ", removed) :
                                        "No products removed");

            context.Done("Items deleted");
        }