Beispiel #1
0
        // GET: Home
        public ActionResult Index()
        {
            var        repo  = BlogRepoFactory.Create();
            HomepageVM model = new HomepageVM();

            List <Blog> featuredBlogs = repo.GetFeaturedBlogs();
            List <Blog> allBlogs      = repo.GetAllBlogs();

            model.AllBlogs      = allBlogs;
            model.FeaturedBlogs = featuredBlogs;
            model.SetCategories(repo.getAllCategories());

            //repo.getBlogCategories(model.AllBlogs);
            //repo.getBlogCategories(model.FeaturedBlogs);


            return(View(model));
        }
        public IActionResult Index()
        {
            var viewModel = new HomepageVM(); //used to generate random numbers in view

            return(View(viewModel));
        }