// GET: Models/Edit/5 public ActionResult Edit(int id) { Model model = Repositry.Get(id); ViewBag.CategoryId = new SelectList(CategoryRepo.GetAll(), "Id", "Name"); return(PartialView("Edit", model)); }
public ActionResult Delete(int id) { try { Model model = Repositry.Get(id); if (model == null) { return(NotFound("The Model is not found")); } this.Repositry.Delete(model); this.Repositry.SaveAll(); return(Ok("The Model has been deleted")); } catch { return(BadRequest("An Error Has Occurred.")); } }