public async Task <TEntity> GetById(int id) { using var context = new JwtWebApiContext(); return(await context.Set <TEntity>().FindAsync(id)); }
public async Task <List <TEntity> > GetAllByFilter(Expression <Func <TEntity, bool> > filter) { using var context = new JwtWebApiContext(); return(await context.Set <TEntity>().Where(filter).ToListAsync()); }
public async Task <TEntity> GetByFilter(Expression <Func <TEntity, bool> > filter) { using var context = new JwtWebApiContext(); return(await context.Set <TEntity>().FirstOrDefaultAsync(filter)); }
public async Task <List <TEntity> > GetAll() { using var context = new JwtWebApiContext(); return(await context.Set <TEntity>().ToListAsync()); }