public IActionResult Index(GalleryFilter filter = null)
        {
            var gallery = _galleryRepo.getQueryable().Where(a => a.is_active == true);

            ViewBag.pagerInfo = _paginatedMetaService.GetMetaData(gallery.Count(), filter.page, filter.number_of_rows);


            gallery = gallery.Skip(filter.number_of_rows * (filter.page - 1)).Take(filter.number_of_rows);

            GalleryViewModel model = getViewModel(gallery);

            return(View(model));
        }
        public IActionResult Index(GalleryFilter filter = null)
        {
            try
            {
                var galleries = _galleryRepository.getQueryable();

                ViewBag.pagerInfo = _paginatedMetaService.GetMetaData(galleries.Count(), filter.page, filter.number_of_rows);
                galleries         = galleries.Skip(filter.number_of_rows * (filter.page - 1)).Take(filter.number_of_rows);
                var gallery        = galleries.ToList();
                var galleryIndexVM = getViewModelFrom(gallery);
                return(View(galleryIndexVM));
            }
            catch (Exception ex)
            {
                AlertHelper.setMessage(this, ex.Message, messageType.error);
                return(Redirect("index"));
            }
        }