public async Task <TEntity> GetById(int id) { using var context = new JwtContext(); return(await context.Set <TEntity>().FindAsync(id)); // throw new NotImplementedException(); }
public async Task <TEntity> GetByFilter(Expression <Func <TEntity, bool> > filter) { using var context = new JwtContext(); return(await context.Set <TEntity>().FirstOrDefaultAsync(filter)); //throw new NotImplementedException(); }
public async Task <List <TEntity> > GetAllByFilter(Expression <Func <TEntity, bool> > filter) { using var context = new JwtContext(); return(await context.Set <TEntity>().Where(filter).ToListAsync()); //throw new NotImplementedException(); }
public async Task <List <TEntity> > GetAll() { //throw new NotImplementedException(); using var context = new JwtContext(); return(await context.Set <TEntity>().ToListAsync()); }
public async Task <T> GetById(int Id) { using var context = new JwtContext(); return(await context.Set <T>().FindAsync(Id)); }
public async Task <T> GetByFilter(Expression <Func <T, bool> > filter) { using var context = new JwtContext(); return(await context.Set <T>().FirstOrDefaultAsync(filter)); }
public async Task <List <T> > GetAllByFilter(Expression <Func <T, bool> > filter) { using var context = new JwtContext(); return(await context.Set <T>().Where(filter).ToListAsync()); }
public async Task <List <T> > GetAll() { using var context = new JwtContext(); return(await context.Set <T>().ToListAsync()); }
public async Task <TEntity> GetById(int id) { var context = new JwtContext(); return(await context.Set <TEntity>().FindAsync(id)); }
public async Task <TEntity> GetByFilter(Expression <Func <TEntity, bool> > filter) { var context = new JwtContext(); return(await context.Set <TEntity>().Where(filter).FirstOrDefaultAsync()); }
public async Task Update(TEntity entity) { using var context = new JwtContext(); context.Set <TEntity>().Update(entity); await context.SaveChangesAsync(); }