Пример #1
0
 public List <T> GetList()
 {
     using (var Db2 = new GerenciadorContext())
     {
         var DbSet2 = Db2.Set <T>();
         return(DbSet2.ToList());
     }
 }
Пример #2
0
 public IEnumerable <T> GetBy(Func <T, bool> predicate)
 {
     using (var Db2 = new GerenciadorContext())
     {
         var DbSet2 = Db2.Set <T>();
         return(DbSet2.Where(predicate)?.ToList());
     }
 }
Пример #3
0
        public HomeController()
        {
            Db    = new GerenciadorContext();
            DbSet = Db.Set <Usuario>();

            //Dapper
            dbConnection = Db.Database.GetDbConnection();
        }
Пример #4
0
 public BaseRepository()
 {
     Db = new GerenciadorContext();
     Db.Configuration.ProxyCreationEnabled = false;
     DbSet = Db.Set <T>();
 }