public ActionResult AnaSayfaByCat(int id) { AnaSayfaViewModel model = new AnaSayfaViewModel(); if (cm.HasCache() == false) { cm.Set(db.Categories.ToList()); } model.CategoryList = cm.Get(); model.ProductList = cm.GetById(x => x.Id == id).Products.ToList(); return(View("AnaSayfa", model)); }
public ActionResult AnaSayfa() { AnaSayfaViewModel model = new AnaSayfaViewModel(); if (cm.HasCache() == false) { cm.Set(db.Categories.ToList()); } model.CategoryList = cm.Get(); model.ProductList = db.Products.ToList(); return(View(model)); }