Exemplo n.º 1
0
        public IActionResult Index(FacultyFilter filter = null)
        {
            try
            {
                var examterm = _facultyRepository.getQueryable();

                if (!string.IsNullOrWhiteSpace(filter.title))
                {
                    examterm = examterm.Where(a => a.name.Contains(filter.title));
                }


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


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

                return(View(examterm.ToList()));
            }
            catch (Exception ex)
            {
                AlertHelper.setMessage(this, ex.Message, messageType.error);
                return(Redirect("/admin"));
            }
        }