public ActionResult DeleteConfirmed(int id) { Daylily daylily = db.Daylilies.Find(id); db.Daylilies.Remove(daylily); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Name,Color,Height,BloomSize")] Daylily daylily) { if (ModelState.IsValid) { db.Entry(daylily).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(daylily)); }
public ActionResult Create([Bind(Include = "ID,Name,Color,Height,BloomSize")] Daylily daylily) { if (ModelState.IsValid) { db.Daylilies.Add(daylily); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(daylily)); }
// GET: Daylily/Delete public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Daylily daylily = db.Daylilies.Find(id); if (daylily == null) { return(HttpNotFound()); } return(View(daylily)); }