public List <T> GetList() { using (var Db2 = new GerenciadorContext()) { var DbSet2 = Db2.Set <T>(); return(DbSet2.ToList()); } }
public IEnumerable <T> GetBy(Func <T, bool> predicate) { using (var Db2 = new GerenciadorContext()) { var DbSet2 = Db2.Set <T>(); return(DbSet2.Where(predicate)?.ToList()); } }
public HomeController() { Db = new GerenciadorContext(); DbSet = Db.Set <Usuario>(); //Dapper dbConnection = Db.Database.GetDbConnection(); }
public BaseRepository() { Db = new GerenciadorContext(); Db.Configuration.ProxyCreationEnabled = false; DbSet = Db.Set <T>(); }