Ejemplo n.º 1
0
        public async Task QnaService_Publish()
        {
            //Read contets of existing markdown files
            var reader = new MarkdownReader();
            await reader.ReadMarkdownFiles(@"C:\VS2015\pp-git\DigitalAssistant.Documentation\Helpcenter\docs");

            if (reader.QuestionWithAnswers.Any())
            {
                //Sdk on top of QnAMaker - V2.0 Rest api
                var service = new QnAService();

                //Get all existing QnA pairs
                var existingData = await service.Get();

                //Remove all existing entries, and add the ones generated from the markdown files
                await service.Update(
                    pairsToDelete : existingData,
                    pairsToAdd : reader.QuestionWithAnswers
                    );

                //Republish
                var published = await service.Publish();
            }
        }
Ejemplo n.º 2
0
 public async Task MarkdownReader_readmarkdownfiles()
 {
     var reader = new MarkdownReader();
     await reader.ReadMarkdownFiles(@"C:\VS2015\pp-git\DigitalAssistant.Documentation\Helpcenter\docs");
 }