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

            await _dbContext.SaveChangesAsync();
        }