Skip to content

remove unused constraints#81

Open
koenbeuk wants to merge 1 commit into
mainfrom
fix/overly-constrained
Open

remove unused constraints#81
koenbeuk wants to merge 1 commit into
mainfrom
fix/overly-constrained

Conversation

@koenbeuk

Copy link
Copy Markdown
Collaborator

Before: expressive overloads would only bind to reference types. that was a bad copy/paste. Now it binds properly to value types as well

Copilot AI review requested due to automatic review settings July 26, 2026 01:33
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../Extensions/ExpressiveQueryableEfCoreExtensions.cs 0.00% 20 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR removes unintended where TEntity : class constraints from EF Core expressive extension stubs so that delegate-based expressive overloads can bind to value-type projections (e.g., after Select(o => o.Price)), aligning the stubs’ generic constraints with EF Core’s actual queryable extension method constraints.

Changes:

  • Removed incorrect reference-type (class) constraints from several EF Core async stub overloads (e.g., SumAsync, AverageAsync, FirstAsync, MinAsync, MaxAsync) and from TagWith/TagWithCallSite.
  • Added integration tests exercising async methods over value-type projections (including a “modern syntax” switch expression).
  • Added a reflection-based test to detect “over-constrained” stubs where Expressive stubs have a class constraint but EF Core targets do not.

Reviewed changes

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

File Description
tests/ExpressiveSharp.EntityFrameworkCore.IntegrationTests/Tests/StubSignatureTests.cs Adds a reflection-based guard test to catch overly restrictive class constraints on expressive EF Core stubs.
tests/ExpressiveSharp.EntityFrameworkCore.IntegrationTests/Infrastructure/AsyncQueryableTestBase.cs Adds integration tests proving async methods work over value-type projections and with modern syntax inside the selector/predicate.
src/ExpressiveSharp.EntityFrameworkCore/Extensions/ExpressiveQueryableEfCoreExtensions.cs Removes incorrect where TEntity : class constraints so stubs bind correctly for value-type element queries.

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

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