private List <Product> GetList(String ID) { var list = db.Get_All().Where(item => item.ID.Contains(ID)).ToList(); foreach (var item in list) { item.Category = MC.Get(item.Category_ID); item.Producer = MP.Get(item.Producer_ID); } return(list); }
// GET: Categories/Edit/5 public ActionResult Edit(int id) { var action = new CheckController().CheckStatus("Categories"); if (action != null) { return(action); } //if (id == null) //{ // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); //} Category categorie = db.Get(id); if (categorie == null) { return(HttpNotFound()); } return(View(categorie)); }