Пример #1
0
 public void Delete(T entity)
 {
     using (Entity.Entities context = new Entity.Entities())
     {
         context.Detach(entity);
         context.SaveChanges();
     }
 }
Пример #2
0
 public void Delete(IList <T> entities)
 {
     using (Entity.Entities context = new Entity.Entities())
     {
         foreach (var o in entities)
         {
             context.Detach(o);
         }
         context.SaveChanges();
     }
 }