Beispiel #1
0
        public PartialViewResult News(int?newsCategoryId, int?page)
        {
            var items = newsCategoryId != null
                ? NewsRepository.GetAllByNewsCategoryId(newsCategoryId.Value).Select(x => x.ToViewModel())
                : NewsRepository.GetAll().Where(x => !x.IsDeleted).Select(x => x.ToViewModel());

            return(PartialView("~/Views/Home/_News.cshtml", items.ToPagedList(page ?? 1, TechOfficeConfig.PAGESIZE)));
        }