public IActionResult List([FromQuery] PagerItem pager, int categoryId = -1) { pager.PageSize = 15; PagedList <ImageEntity> entities = _service.GetPagedList(pager.Page, pager.PageSize, categoryId); ViewBag.CategoryList = _categoryService.GetAll(); ViewBag.CategoryId = categoryId; return(View(entities)); }
public IActionResult List() { List <ImageCategoryEntity> entities = _service.GetAll(); List <ImageCategoryModel> models = entities.Select(entity => { ImageCategoryModel model = new ImageCategoryModel { Id = entity.Id, Title = entity.Title, Desc = entity.Desc, Sequence = entity.Sequence, CreateTime = entity.CreateTime, ImageCount = _imageService.GetCountByCategoryId(entity.Id) }; return(model); }).ToList(); return(View(models)); }