Exemplo n.º 1
0
 public void Delete(T entity)
 {
     context.Set <T>().Attach(entity);
     context.Entry(entity).State = EntityState.Deleted;
     context.Set <T>().Remove(entity);
 }
Exemplo n.º 2
0
 public void Update(T entity)
 {
     DbSet.Attach(entity);
     context.Entry(entity).State = EntityState.Modified;
 }