private async Task <DialogTurnResult> ShowAppointmentsAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { var notificationOfIllnessDetails = (NotificationOfIllnessDetails)stepContext.Result; var appointments = new Appointments(notificationOfIllnessDetails.TokenResponse, m_ExchangeSettings); var appointmentList = appointments.GetAppointments(notificationOfIllnessDetails.SickUntil.GetValueOrDefault()); if (appointmentList.Count == 0) { var noAppointmentsMsg = "Du hast keine Termine die ich absagen muss."; await stepContext.Context.SendActivityAsync(MessageFactory.Text(noAppointmentsMsg, noAppointmentsMsg, InputHints.IgnoringInput), cancellationToken); return(await stepContext.EndDialogAsync(null, cancellationToken)); } var appointmentsMsg = "Du hast folgende Termine die ich absagen kann."; await stepContext.Context.SendActivityAsync(MessageFactory.Text(appointmentsMsg, appointmentsMsg, InputHints.IgnoringInput), cancellationToken); // Reply to the activity we received with an activity. var reply = MessageFactory.Attachment(new List <Attachment>()); reply.AttachmentLayout = AttachmentLayoutTypes.Carousel; foreach (var appointment in appointmentList) { reply.Attachments.Add(GetAppointmentCard(appointment).ToAttachment()); } // Send the card(s) to the user as an attachment to the activity await stepContext.Context.SendActivityAsync(reply, cancellationToken); var messageText = "Soll ich diese absagen?"; var promptMessage = MessageFactory.Text(messageText, messageText, InputHints.ExpectingInput); return(await stepContext.PromptAsync(nameof(ConfirmPrompt), new PromptOptions { Prompt = promptMessage }, cancellationToken)); }