public IActionResult add()
 {
     try
     {
         PageModel pageModel      = new PageModel();
         var       pageCategories = _pageCategoryRepo.getQueryable().ToList();
         ViewBag.categories = new SelectList(pageCategories, "page_category_id", "name");
         return(View(pageModel));
     }
     catch (Exception ex)
     {
         AlertHelper.setMessage(this, ex.Message, messageType.error);
         return(RedirectToAction("index"));
     }
 }
        public IActionResult Index(PageCategoryFilter filter = null)
        {
            try
            {
                var pageCategories = _pageCategoryRepo.getQueryable();
                if (!string.IsNullOrWhiteSpace(filter.title))
                {
                    pageCategories = pageCategories.Where(a => a.name.Contains(filter.title));
                }

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

                pageCategories = pageCategories.Skip(filter.number_of_rows * (filter.page - 1)).Take(filter.number_of_rows);
                var pageCat = pageCategories.ToList();

                var pageCategoriesIndexVM = getViewModelFrom(pageCat);
                return(View(pageCategoriesIndexVM));
            }
            catch (Exception ex)
            {
                AlertHelper.setMessage(this, ex.Message, messageType.error);
                return(Redirect("/admin"));
            }
        }