Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
        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));
        }
Esempio n. 6
0
        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));
        }