public ActionResult Customer() { var model = new DetailsCategory { Articles = db.Articles.OrderByDescending(x => x.CreateDate).ToList() }; return(View(model)); }
public ActionResult category(int catid) { ViewBag.messenger = "Giới thiệu"; var category = db.Categories.Find(catid); if (category == null) { return(RedirectToAction("Index")); } //var article = db.Articles.Where(x => x.CategoryId == catid).OrderBy(x => x.CreateDate).ToList(); var model = new DetailsCategory { Baners = db.Baners.ToList(), Category = category, Articles = db.Articles.OrderByDescending(x => x.CreateDate), CategoryHome = db.Categories.ToList() }; return(View(model)); }