public ActionResult DeleteConfirmed(int id) { FeaturedJam featuredJam = db.FeaturedJams.Find(id); db.FeaturedJams.Remove(featuredJam); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "FeaturedJamID,Title,Author,DatePublished,Content")] FeaturedJam featuredJam) { if (ModelState.IsValid) { db.Entry(featuredJam).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(featuredJam)); }
public ActionResult Create([Bind(Include = "FeaturedJamID,Title,Author,DatePublished,Content")] FeaturedJam featuredJam) { if (ModelState.IsValid) { db.FeaturedJams.Add(featuredJam); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(featuredJam)); }
// GET: Featured/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FeaturedJam featuredJam = db.FeaturedJams.Find(id); if (featuredJam == null) { return(HttpNotFound()); } return(View(featuredJam)); }