public ActionResult DeleteConfirmed(int id) { Attribute attribute = db.Attributes.Find(id); db.Attributes.Remove(attribute); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Type")] Attribute attribute) { if (ModelState.IsValid) { db.Entry(attribute).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(attribute)); }
public ActionResult Create([Bind(Include = "Id,Type")] Attribute attribute) { if (ModelState.IsValid) { db.Attributes.Add(attribute); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(attribute)); }
// GET: AdminArea/Attributes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Attribute attribute = db.Attributes.Find(id); if (attribute == null) { return(HttpNotFound()); } return(View(attribute)); }