Exemplo n.º 1
0
        public ActionResult ViewCategory(int id)
        {
            _ops = new BlogOperations();
            var vM = new ViewCategoryVM();
            vM.BlogPosts = _ops.GetAllBlogPosts().BlogPosts.Where(p => p.Category.CategoryId == id).OrderByDescending(p => p.TimeCreated).ToList();

            vM.Categories = _ops.GetAllCategories().Categories;
            vM.CurrentCategory.CategoryId = id;
            vM.CurrentCategory.CategoryTitle = _ops.GetCategoryById(id).Category.CategoryTitle;

            return View("ViewCategory", vM);
        }