Exemple #1
0
        private async Task PostAsync(IDialogContext context, string response)
        {
            // get all cuisines in the current location
            var cuisines = await RestaurantService.GetCuisinesAsync(context.Location());

            // create suggestions for each cuisine
            var cards = cuisines.Select(c => new CardAction {
                Title = $"{c.Name} ({c.Count})", Value = c.Name, Type = ActionTypes.ImBack
            }).ToList();

            // create a message with suggested cuisines to the user
            var message = context.MakeMessage();

            message.Text             = response;
            message.SuggestedActions = new SuggestedActions {
                Actions = cards
            };

            // send suggestions to the user
            await context.PostAsync(message);
        }