Exemplo n.º 1
0
        public async Task <IActionResult> SearchQuestion(string search)
        {
            QuestionViewModel webModel = JsonUtility.ToObject <QuestionViewModel>(search);

            webModel = await _service.SearchQuestionAsync(webModel, _context);

            //Search Or Init
            bool flag = string.IsNullOrEmpty(webModel.SAskFor) && string.IsNullOrEmpty(webModel.SDateTime) && webModel.IsReply == -1;

            var returnData = new
            {
                data  = webModel.QuestionList,
                limit = webModel.Limit,
                page  = flag ? webModel.Page : 1,
                total = webModel.Total
            };

            return(Json(returnData));
        }