Ejemplo n.º 1
0
 public async Task <T> GetOne(Guid id)
 {
     using (var db = new PostgresContext())
     {
         return(await db.Set <T>().FindAsync(id));
     }
 }
Ejemplo n.º 2
0
 public async Task <List <T> > GetAll()
 {
     using (var db = new PostgresContext())
     {
         return(await db.Set <T>().ToListAsync());
     }
 }
Ejemplo n.º 3
0
 public async Task <int> Update(T entity)
 {
     using (var db = new PostgresContext())
     {
         db.Set <T>();
         db.Update(entity);
         return(await db.SaveChangesAsync());
     }
 }
Ejemplo n.º 4
0
 public UserRepository(PostgresContext db)
 {
     this.context = db;
     this.users   = db.Set <User>();
 }
Ejemplo n.º 5
0
 public IQueryable <TEntity> GetAll()
 {
     return(_postgresContext.Set <TEntity>().AsNoTracking());
 }
Ejemplo n.º 6
0
 protected RepositoryBase(PostgresContext storeContext)
 {
     _storeContext = storeContext;
     _dbSet        = _storeContext.Set <T>();
 }
Ejemplo n.º 7
0
 public ContestParticipantRepository(PostgresContext db)
 {
     this.context             = db;
     this.contestParticipants = db.Set <ContestParticipant>();
 }
Ejemplo n.º 8
0
 public GenericRepository(PostgresContext context)
 {
     _context = context;
     dataset  = _context.Set <T>();
 }
 public SerialNumberRepository(PostgresContext db)
 {
     this.context       = db;
     this.serialNumbers = db.Set <SerialNumber>();
 }