Example #1
0
        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 }));
        }
Example #2
0
        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);
        }
Example #3
0
 public int GetCount(GalleryCondition condition = null)
 {
     return(_galleryRepository.SelectCount());
 }