Example #1
0
 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());
 }
Example #3
0
        public async Task Create(T entity)
        {
            await _dbContext.Set <T>().AddAsync(entity);

            await _dbContext.SaveChangesAsync();
        }