public async Task <bool> Delete <T>(T item) where T : class { try { _db.Set <T>().Remove(item); return(await _db.SaveChangesAsync() >= 0); } catch { return(false); } }
public async Task <List <TEntity> > GetAsync <TEntity>() where TEntity : class { return(await _db.Set <TEntity>().ToListAsync()); }
public async Task <bool> AnyAsync <TEntity>(Expression <Func <TEntity, bool> > expression, bool include = false) where TEntity : class { return(await _db.Set <TEntity>().AnyAsync(expression)); }