Added very nice DataGrid control
This commit is contained in:
@ -22,10 +22,7 @@ namespace UserService.DatabaseLayer.Repository
|
||||
public virtual async Task<IReadOnlyList<T>> GetAllAsync(Expression<Func<T, bool>>? predicate = null, CancellationToken token = default)
|
||||
{
|
||||
await using var db = new UserServiceDbContext();
|
||||
|
||||
IQueryable<T> queryable = Context(db).Include(x => x.Parent);
|
||||
if(predicate != null) queryable = queryable.Where(predicate);
|
||||
return await queryable.ToListAsync(token);
|
||||
return await Context(db).Include(x => x.Parent).WhereOrDefault(predicate).ToListAsync(token);
|
||||
}
|
||||
|
||||
public async Task<T?> GetAsync(Expression<Func<T, bool>> predicate, CancellationToken token = default)
|
||||
|
Reference in New Issue
Block a user