public void Update2(T entity) { using (var Db2 = new GerenciadorContext()) { Db.Entry(entity).State = EntityState.Modified; Db.SaveChanges(); } }
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 UsuarioController(GerenciadorContext context) { _context = context; }
public TarefaController(GerenciadorContext context) { _context = context; }
public BaseRepository() { Db = new GerenciadorContext(); Db.Configuration.ProxyCreationEnabled = false; DbSet = Db.Set <T>(); }