-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[release/9.0-staging] Handle .NET 10 MemoryExtensions.Contains overload with comparer #37183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
artl93
approved these changes
Nov 17, 2025
Member
artl93
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for me. (See questions in the 8.0 backport.)
48e87f1 to
407c68d
Compare
407c68d to
a97c428
Compare
SamMonoRT
approved these changes
Nov 17, 2025
This was referenced Dec 10, 2025
This was referenced Jan 13, 2026
Open
Open
Open
Merged
This was referenced Jan 15, 2026
Bump Microsoft.EntityFrameworkCore.Design from 8.0.11 to 9.0.12
AhmedAzzu25/PharmacyInventoryDemo#12
Open
Closed
Open
Closed
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #37176 for EF 9.0 (see #37182 for 8.0 fix)
Description
C# 14 first-class spans causes MemoryExtensions.Contains instead of Enumerable.Contains to be resolved, forcing LINQ providers to identify the former in additional to the latter. In addition, .NET 10 introduced a 3-parameter overload to MemoryExtensions.Contains which accepts a comparer, that gets resolved in some situations. While we already backported support for MemoryExtensions.Contains to EF Core 8 and 9, to allow these versions to work with C# 14, we didn't backport a separate change to also support the new .NET 10 overload.
Customer impact
Customers upgrading to .NET 10 but staying on EF 8 or 9 start experiencing failures in some LINQ queries that use Contains. The common case is Contains over an enum array:
Customers upgrading to EF 10 are not affected.
How found
Multiple customers reported on 9.0
Regression
Partial: occurs only when upgrading to .NET 10 but keeping older EF 8 or 9.
Testing
Tested manually, as we don't have automated testing for .NET 10 on older EF versions.
Risk
Very low, targeted change that's very low-risk, and already well-tested in EF 10. Quirk added.