예제 #1
0
 public BaseRepository(MeuDbContext db)
 {
     _db   = db;
     DBSet = db.Set <TEntity>();
 }
예제 #2
0
        public async Task Adicionar(Cidade cidade)
        {
            await _context.Set <Cidade>().AddAsync(cidade);

            await _context.SaveChangesAsync();
        }
예제 #3
0
 protected Repository(MeuDbContext context)
 {
     _context = context;
     _set     = _context.Set <T> ();
 }
예제 #4
0
 public Repository(MeuDbContext dbContext)
 {
     Db    = dbContext;
     DbSet = Db.Set <TEntity>();
 }
예제 #5
0
 public virtual async Task Adicionar(TEntity entity)
 {
     Db.Set <TEntity>().Add(entity); // Ou DbSet.Add(entity)
     await SaveChanges();
 }
예제 #6
0
 protected Repository(MeuDbContext context)
 {
     _context = context;
     Db       = _context.Set <TEntity>();
 }
예제 #7
0
 public Repository(MeuDbContext db)
 {
     _context = db;
     _dbSet   = db.Set <TEntity>();
 }
예제 #8
0
 public Repository(MeuDbContext context)
 {
     _Db   = context;
     DbSet = _Db.Set <TEntity>();
 }
예제 #9
0
 public Repository(MeuDbContext context)
 {
     _context = context;
     _set     = _context.Set <TEntity>();
 }
예제 #10
0
 public PapelRepository(MeuDbContext dbContext)
 {
     _dbContext = dbContext;
     _dbSet     = dbContext.Set <Papel>();
 }
예제 #11
0
        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>();
 }
예제 #13
0
 public Repository(MeuDbContext meuDbContext)
 {
     _meuDbContext = meuDbContext;
     dbSet         = meuDbContext.Set <TEntity>();
 }
 public Repository(MeuDbContext db)
 {
     Db    = db;
     DbSet = db.Set <TEntity>();
 }
예제 #15
0
 public ProspectEmployeeRepository(MeuDbContext db)
 {
     Db    = db;
     DbSet = db.Set <ProspectEmployee>();
 }
예제 #16
0
 protected Repository(MeuDbContext db)
 {
     Db    = db;
     DbSet = db.Set <TEntity>();
 }
예제 #17
0
        public async Task Adicionar(Aluno aluno)
        {
            await _context.Set <Aluno>().AddAsync(aluno);

            await _context.SaveChangesAsync();
        }