Skip to content
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

[release/3.1] Query: Use stronger reflection in Queryable/Enumerable methods (#24090) #24115

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

smitpatel
Copy link
Contributor

Resolves #24002

Description

As per dotnet/runtime#28776, there are new queryable/enumerable method overloads of existing methods are being added. We use reflection to get some of the methods which EF Core translates and uses in generating result. Those new overloads could cause error in finding correct method.

Customer Impact

Customers won't be able to use EF Core 3.1 on net6 platform.

How found

Indicated on API proposal by customers.

Test coverage

Whole query pipeline uses both classes so any error in reflection will cause all query tests to fail due to type initialization error.

Regression?

No. This is to make code forward-compatible for platform.

Risk

Very low. All tests verify that current code for reflection is correct. Comparison based on exact type of arguments validates that this would not need to be changed in future.

@smitpatel smitpatel changed the title Query: Use stronger reflection in Queryable/Enumerable methods (#24090) [release/3.1] Query: Use stronger reflection in Queryable/Enumerable methods (#24090) Feb 10, 2021
@ajcvickers ajcvickers added this to the 3.1.x milestone Feb 17, 2021
@ajcvickers
Copy link
Member

@smitpatel Were you able to verify whether 2.1 also has this issue?

@smitpatel
Copy link
Contributor Author

EF Core 2.1 doesn't have this specific issue because the code doesn't exist in 2.1 but it can still get broken mainly because Remotion.Linq parses expression tree for us. And those methods would throw up that library if it is not going reflection propertly.

@ajcvickers
Copy link
Member

@smitpatel Have you verified this? If Remotion.Linq does fail, does that mean that any LINQ provider that uses it will fail?

@smitpatel
Copy link
Contributor Author

Remotion.Linq does not have faulty reflection but it doesn't have specific method selected to generate operations, instead it works with all overloads. It may just work as long new methods are not being used in query. But without running the code it is hard to say for sure.

@wtgodbe
Copy link
Member

wtgodbe commented Mar 9, 2021

@smitpatel who should review this? Branches are open until EOD Thursday

@smitpatel smitpatel requested a review from a team March 10, 2021 00:20
@wtgodbe wtgodbe merged commit 8fbe0c3 into release/3.1 Mar 10, 2021
@wtgodbe wtgodbe deleted the smit/mirror3.1 branch March 10, 2021 00:43
@ajcvickers ajcvickers removed this from the 3.1.14 milestone Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants