Skip to content

added IAsyncEnumerable support to IncludableExpressiveQueryableWrapper#72

Merged
koenbeuk merged 4 commits into
mainfrom
fix/include-then-async
Jun 4, 2026
Merged

added IAsyncEnumerable support to IncludableExpressiveQueryableWrapper#72
koenbeuk merged 4 commits into
mainfrom
fix/include-then-async

Conversation

@koenbeuk
Copy link
Copy Markdown
Collaborator

@koenbeuk koenbeuk commented Jun 4, 2026

Before query.Include(x => x.Foo).ToListAsync() was unavailable as IncludableExpressiveQueryableWrapper did not implement IAsyncEnumerable

Copilot AI review requested due to automatic review settings June 4, 2026 00:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables async terminal EF Core operations (e.g., ToListAsync, ToArrayAsync) on Include/ThenInclude chains built from expressive query sources by making the includable wrapper async-enumerable, and adds integration tests covering the scenario.

Changes:

  • Implemented IAsyncEnumerable<TEntity> on IncludableExpressiveQueryableWrapper<TEntity, TProperty> by delegating async enumeration to the underlying EF Core query.
  • Added integration tests validating Include(...).ToListAsync(), Include(...).ToArrayAsync(), and Include(...).ThenInclude(...).ToListAsync() on Context.ExpressiveOrders.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tests/ExpressiveSharp.EntityFrameworkCore.IntegrationTests/Infrastructure/AsyncQueryableTestBase.cs Adds integration tests for async terminal operations after Include/ThenInclude on expressive queries.
src/ExpressiveSharp.EntityFrameworkCore/Infrastructure/IncludableExpressiveQueryableWrapper.cs Adds IAsyncEnumerable<TEntity> support so EF Core async terminal methods can enumerate includable expressive queries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +123
public async Task Include_ToListAsync_DirectTerminal_LoadsNavigation()
{
var results = await Context.ExpressiveOrders
Comment on lines +132 to +134
public async Task Include_ToArrayAsync_DirectTerminal_LoadsNavigation()
{
var results = await Context.ExpressiveOrders
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

❌ Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...astructure/IncludableExpressiveQueryableWrapper.cs 20.00% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@koenbeuk koenbeuk merged commit c7e9cba into main Jun 4, 2026
17 checks passed
@koenbeuk koenbeuk deleted the fix/include-then-async branch June 4, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants