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