public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest)); } var furniture = _db.GetById(id); if (furniture == null) { return(HttpNotFound()); } return(View(furniture)); }
public ActionResult AddToCart(int?furnitureId) { Furniture furniture = _db.GetById(furnitureId); GetCart().AddItem(furniture, 1); return(RedirectToAction("Index", "Furnitures", new { area = "" })); }