public void Delete(T entity) { using (Entity.Entities context = new Entity.Entities()) { context.Detach(entity); context.SaveChanges(); } }
public void Delete(IList <T> entities) { using (Entity.Entities context = new Entity.Entities()) { foreach (var o in entities) { context.Detach(o); } context.SaveChanges(); } }