public void DeleteContact(Contact c) { if (c == null) return; using (var e = new AdventureWorksEntities()) { e.Attach(c); e.DeleteObject(c); e.SaveChanges(); } }