コード例 #1
0
        public async Task <IActionResult> LoadAcByAcId(int aid)
        {
            var result = await _article.GetAcByAcid(aid);

            //不允许循环序列化
            var setting = new JsonSerializerSettings();

            setting.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;

            return(Json(result, setting));
        }
コード例 #2
0
        public async Task <IActionResult> SelectArticle(int id)
        {
            var acdata = await _article.GetAcByAcid(id);

            ViewData["ModelId"] = acdata.WZZModel.id;
            if (acdata.id == 0)
            {
                return(NotFound());
            }
            await VisitUser(id);

            return(View("Index_Article", acdata));
        }