public ActionResult DeleteConfirmed(Guid id) { MyJellyBean myJellyBean = db.MyJellyBeans.Find(id); db.MyJellyBeans.Remove(myJellyBean); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,JellyBeanName,TotalBeans")] MyJellyBean myJellyBean) { if (ModelState.IsValid) { db.Entry(myJellyBean).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(myJellyBean)); }
public ActionResult Create([Bind(Include = "Id,JellyBeanName,TotalBeans")] MyJellyBean myJellyBean) { if (ModelState.IsValid) { myJellyBean.Id = Guid.NewGuid(); db.MyJellyBeans.Add(myJellyBean); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(myJellyBean)); }
// GET: MyJellyBeans/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MyJellyBean myJellyBean = db.MyJellyBeans.Find(id); if (myJellyBean == null) { return(HttpNotFound()); } return(View(myJellyBean)); }