public async Task <User> GetByUsername(string username) { return(await _dbContext.Set <User>() .AsNoTracking() .FirstOrDefaultAsync(e => e.Username == username)); }
public async Task <IReadOnlyList <T> > GetAllAsync() { return(await _dbContext.Set <T>().ToListAsync()); }
public async Task Create(T entity) { await _dbContext.Set <T>().AddAsync(entity); await _dbContext.SaveChangesAsync(); }