예제 #1
0
 public virtual void Atualiza(T item)
 {
     using (var contexto = new BaseContexto())
     {
         contexto.Entry(item).State = System.Data.Entity.EntityState.Modified;
         contexto.SaveChanges();
     }
 }
예제 #2
0
 public virtual void Excluir(T item)
 {
     using (var contexto = new BaseContexto())
     {
         contexto.Entry <T>(item).State = EntityState.Deleted;
         contexto.SaveChanges();
     }
 }