예제 #1
0
 public List <T> Listar()
 {
     using (var db = new SistemaDeEventosContext())
     {
         return(db.Set <T>().Where(x => !x.FlagExcluido).ToList());
     }
 }
예제 #2
0
        public T Inserir(T modelo)
        {
            using (var db = new SistemaDeEventosContext())
            {
                db.ChangeTracker.AutoDetectChangesEnabled = false;

                db.Set <T>().Add(modelo);

                db.SaveChanges();

                return(modelo);
            }
        }