public StillInterestedDialog(StillInterestedEntity message) { question = message.Question; messageType = message.MessageType; conversationReference = message.ConversationReference; answer = message.Answer; }
private async Task StoreOnStillInterestedTable(IDialogContext context, IQnaResponse qnaAnswer) { var entity = new StillInterestedEntity(context.Activity.ChannelId, context.Activity.From.Id, MessageHelper.NormalizeString(qnaAnswer.Question)) { ConversationId = context.Activity.Conversation.Id, Timestamp = DateTime.UtcNow, Answer = qnaAnswer.Answer, ReceivedAnswer = true, ConversationReference = JsonConvert.SerializeObject(context.Activity.AsMessageActivity().ToConversationReference()) }; var tableContent = await tableStorageProvider.SendToTableAsync("stillInterested", entity); }
private async Task AfterAreYouStillInterested(IDialogContext context, IAwaitable <bool> result) { var confirm = await result; var entity = new StillInterestedEntity(context.Activity.ChannelId, context.Activity.From.Id, MessageHelper.NormalizeString(question)) { ConversationId = context.Activity.Conversation.Id, Timestamp = DateTime.UtcNow, ConversationReference = conversationReference, Answer = answer, }; if (confirm) { await context.PostAsync(messageProvider.GetMessage("ResendingQuestion")); var messageToSend = new MessageEntity() { Question = question, MessageType = messageType, OriginalAnswer = answer, QuestionCorrelationId = Guid.NewGuid() }; await queueProvider.InsertInQueueAsync("usertoexpert", messageToSend); entity.ReceivedAnswer = false; } else { entity.ReceivedAnswer = true; await context.PostAsync(messageProvider.GetMessage("ForgettingQuestion")); } await tableStorageProvider.SendToTableAsync("stillInterested", entity); await context.PostAsync(messageProvider.GetMessage("WhatMoreCanIDo")); context.Done(0); }