private async Task <DialogDto> StartFlowAnswer(QandA answer, string conversationId) { MoMoBotAssert.ValueNullOrWhiteSpace(answer.FlowId); var start = await _mapContext.StartAsync(answer.FlowId, conversationId); return(new DialogDto(conversationId, answer.Id, answer.Intent, start?.Question, AnswerTypes.ProcessFlow)); }
public async Task SetAsync(string key, string value) { MoMoBotAssert.KeyNotNullOrEmpty(key); MoMoBotAssert.ValueNullOrWhiteSpace(value); var setting = await _dbContext.Settings.FirstOrDefaultAsync(s => s.Key == key); if (setting != null) { if (setting.ReadOnly == false) { setting.Value = value; _dbContext.Settings.Update(setting); await _dbContext.SaveChangesAsync(); await GetSettingsFromDBAsync(); } } }
public Dialog(string dialogId) { MoMoBotAssert.ValueNullOrWhiteSpace(dialogId); Id = dialogId; }