public ActionResult AjaxGetList(JQueryDataTableSearchDTO searchDTO) { var listDTO = _blogArticleService.GetList(searchDTO, UserContext.CurrentUser); return(Json(new { sEcho = searchDTO.sEcho, iTotalRecords = listDTO.TotalRecords, iTotalDisplayRecords = listDTO.TotalRecords, aaData = listDTO.List }, JsonRequestBehavior.AllowGet)); }
public BlogArticleListDTO GetList(JQueryDataTableSearchDTO searchDTO, IUserBasicInfo userInfo) { BlogArticleSearchDTO blogSearchDTO = new BlogArticleSearchDTO() { PageIndex = searchDTO.PageIndex, PageSize = searchDTO.iDisplayLength, UserID = userInfo.UserID }; BlogArticleListDTO result = new BlogArticleListDTO(); long totalCount = 0; var entityList = this.dal.GetList(blogSearchDTO, out totalCount); result.TotalRecords = totalCount; result.List = entityList.Select(m => Mapper.DynamicMap <BlogArticleListItemDTO>(m)).ToList(); return(result); }