public ApiResult Upload([FromBody] GalleryCondition galleryCondition) { List <GalleryDTO> list = _galleryService.GetListPage(galleryCondition.CurrentPage, galleryCondition.PageSize, galleryCondition); int total = _galleryService.GetCount(galleryCondition); return(ApiResult.Success(new { list, total })); }
public List <GalleryDTO> GetListPage(int currentPage, int pageSize, GalleryCondition condition = null) { IEnumerable <Gallery> galleries = _galleryRepository.SelectByPage(currentPage, pageSize); List <GalleryDTO> list = new List <GalleryDTO>(); foreach (var item in galleries) { GalleryDTO galleryDTO = new GalleryDTO(); galleryDTO.Url = item.Url; list.Add(galleryDTO); } return(list); }
public int GetCount(GalleryCondition condition = null) { return(_galleryRepository.SelectCount()); }