Example #1
0
        public JsonResult CheckIfUpdatedQuestion(int itemid) //change signature to string and then convert to int
        {
            string baseUrl = HttpRuntime.AppDomainAppPath;
            string jsonUrl = baseUrl + jsonName;
            var    qnaList = new List <QnAItem>();
            var    qnaItem = RequestHandler.FetchQnaItem(itemid, jsonUrl);

            qnaList.Add(qnaItem);

            //var qnaService = new QnASyncService(ConfigurationManager.AppSettings["QnaMakerKnowledgebaseId"], ConfigurationManager.AppSettings["QnAMakerSubscriptionKey"], "QnASyncTesting");
            var  qnaService       = new QnASyncService("07fbe223-9502-44d9-b762-d0164cd678e2", ConfigurationManager.AppSettings["QnAMakerSubscriptionKey"], "QnAManual");
            bool changedQuestions = qnaService.CheckIfUpdatedQuestion(qnaItem);

            if (!changedQuestions)
            {
                SyncItem(itemid, false);
            }

            return(Json(new { result = changedQuestions }, JsonRequestBehavior.AllowGet));
        }