示例#1
0
 /// <summary>
 /// 根据请求类型返回view或json
 /// </summary>
 /// <param name="model"></param>
 /// <param name="viewName"></param>
 /// <returns></returns>
 protected IActionResult DynamicResult(object model, string viewName = "")
 {
     if (IsRequestJson)
     {
         return(JResult.J(model));
     }
     viewName = viewName.IfEmpty(WebContext.ActionName);
     return(View(viewName, model));
 }
示例#2
0
 protected IActionResult JsonResult(bool isSuccess, object content, object extra = null)
 {
     return(JResult.J(isSuccess, content, extra));
 }
示例#3
0
 protected IActionResult JsonResult(object content, object extra = null)
 {
     return(JResult.J("success", content, extra));
 }