public BaseRepository(MeuDbContext db) { _db = db; DBSet = db.Set <TEntity>(); }
public async Task Adicionar(Cidade cidade) { await _context.Set <Cidade>().AddAsync(cidade); await _context.SaveChangesAsync(); }
protected Repository(MeuDbContext context) { _context = context; _set = _context.Set <T> (); }
public Repository(MeuDbContext dbContext) { Db = dbContext; DbSet = Db.Set <TEntity>(); }
public virtual async Task Adicionar(TEntity entity) { Db.Set <TEntity>().Add(entity); // Ou DbSet.Add(entity) await SaveChanges(); }
protected Repository(MeuDbContext context) { _context = context; Db = _context.Set <TEntity>(); }
public Repository(MeuDbContext db) { _context = db; _dbSet = db.Set <TEntity>(); }
public Repository(MeuDbContext context) { _Db = context; DbSet = _Db.Set <TEntity>(); }
public Repository(MeuDbContext context) { _context = context; _set = _context.Set <TEntity>(); }
public PapelRepository(MeuDbContext dbContext) { _dbContext = dbContext; _dbSet = dbContext.Set <Papel>(); }
protected readonly DbSet <TEntity> DbSet; // atalho para Db set protected Repository(MeuDbContext db) { Db = db; DbSet = db.Set <TEntity>(); // atalho para Db set }
protected Repository(MeuDbContext db) { _db = db ?? throw new ArgumentNullException(nameof(db)); DbSet = _db.Set <TEntity>(); }
public Repository(MeuDbContext meuDbContext) { _meuDbContext = meuDbContext; dbSet = meuDbContext.Set <TEntity>(); }
public Repository(MeuDbContext db) { Db = db; DbSet = db.Set <TEntity>(); }
public ProspectEmployeeRepository(MeuDbContext db) { Db = db; DbSet = db.Set <ProspectEmployee>(); }
protected Repository(MeuDbContext db) { Db = db; DbSet = db.Set <TEntity>(); }
public async Task Adicionar(Aluno aluno) { await _context.Set <Aluno>().AddAsync(aluno); await _context.SaveChangesAsync(); }