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