public IActionResult Index() { HomeBlogModel model = new HomeBlogModel(); model.HomeBlogs = _blogRepo.GetAll().Where(i => i.isApproved && i.isHome).ToList(); model.SliderBlogs = _blogRepo.GetAll().Where(i => i.isApproved && i.isSlider).ToList(); return(View(model)); }
public IActionResult Index() { var model = new HomeBlogModel(); model.HomeBlogs = blogRepository.GetAll().Where(i => i.IsApproved && i.IsHome).ToList(); model.SliderBlogs = blogRepository.GetAll().Where(i => i.IsApproved && i.IsSlider).ToList(); return(View(model)); }
public IActionResult Index() { HomeBlogModel model = new HomeBlogModel(); model.HomeBlogs = blogRepository.GetAll().Where(i => i.isApproved && i.isHome).OrderByDescending(i => i.Date).ToList(); model.SliderBlogs = blogRepository.GetAll().Where(i => i.isApproved && i.isSlider).ToList(); return(View(model)); }
public IActionResult Index() { var model = new HomeBlogModel(); model.HomeBlogs = blogRepository.GetAll().Where(x => x.isApproved == true && x.isHome == true).ToList(); model.SliderBlogs = blogRepository.GetAll().Where(x => x.isApproved == true && x.isSlider == true).ToList(); return(View(model)); }
public IActionResult Index() { var pageModel = new HomeBlogModel { HomeBlogs = _blogRepository.GetAll().Where(x => x.IsApproved && x.IsHome).ToList(), SliderBlogs = _blogRepository.GetAll().Where(x => x.IsApproved && x.IsSlider).ToList() }; return(View(pageModel)); }
public IActionResult Index() { var model = new HomeBlogModel { HomeBlogs = _blogRepository.GetAll() .Where(i => i.IsApproved && i.IsHome) .OrderByDescending(i => i.DateTime), SliderBlogs = _blogRepository.GetAll() .Where(i => i.IsApproved && i.IsSlider) .OrderByDescending(i => i.DateTime) }; return(View(model)); }