public ActionResult Details(T o) { ChrisbzdEntities db = new ChrisbzdEntities(); var set = db.Set(typeof(T)); if (this.IsNew(o)) { set.Add(o); } else { db.Entry((object)o).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } db.SaveChanges(); return(RedirectToAction("List")); }
public ActionResult Delete(int id) { var db = new ChrisbzdEntities(); var set = db.Set(typeof(T)); var c = set.Find(id); set.Remove(c); db.SaveChanges(); return(RedirectToAction("List")); }