public Task StartAsync(IDialogContext context) { try { // Load QnA Services from database // Create the database context first SupportBotContext db = new SupportBotContext(); // Load the available QnA services sets from the database var qnaServicesSet = db.Set <QnAMakerService>(); // Add the QnA service references to the QnA Maker Client foreach (var item in qnaServicesSet) { client.QnAServices.Add(item); } context.Wait(MessageReceivedAsync); } catch (Exception e) { //TODO Remove context.PostAsync(e.Message); // If the database isn't available or if there is any other problem, let the user know and end the dialog context.PostAsync(Resources.BotTexts.DatebaseNotAvailable); context.Done(String.Empty); } return(Task.CompletedTask); }
public Task StartAsync(IDialogContext context) { try { // Load QnA Services from Database SupportBotContext db = new SupportBotContext(); var qnaServicesSet = db.Set <QnAMakerService>(); foreach (var item in qnaServicesSet) { client.QnAServices.Add(item); } // Display a promt choise with all the different technologies available PromptDialog.Choice(context, AfterTechnologySelectedAsync, client.ServiceNames, Resources.BotTexts.CategorySelectionQuestion, Resources.BotTexts.PleaseUseButtons); } catch (Exception) { // If the database if not available notify the user context.PostAsync(Resources.BotTexts.DatebaseNotAvailable); context.Done(String.Empty); } return(Task.CompletedTask); }
public QnAPairsController(SupportBotContext context) { _context = context; }
public QnAMakerServicesController(SupportBotContext context) { _context = context; }