Added very nice DataGrid control

This commit is contained in:
2020-08-04 22:47:35 +02:00
parent 8eace42aaa
commit 5d3c64d193
20 changed files with 157 additions and 376 deletions

View File

@ -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)