public async Task <IPagedList <TestNavigation> > GetPaginatedTestNavigation(GetPaginatedTestNavigationQuery query) { return(await GetTestIncludeQueryable() .Where(ToExpression(query)) .Select(t => ToTestNavigation(t)) .FromPaginationQueryAsync(query)); }
private static Expression <Func <Test, bool> > ToExpression(GetPaginatedTestNavigationQuery query) { return(test => !test.IsDeleted && (query.StepId == null || query.StepId == test.Step.Id)); }