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

Compare to all Queryable/Enumerable methods via MethodInfo, not by name #16300

Closed
1 task
roji opened this issue Jun 27, 2019 · 10 comments
Closed
1 task

Compare to all Queryable/Enumerable methods via MethodInfo, not by name #16300

roji opened this issue Jun 27, 2019 · 10 comments
Assignees
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. punted-for-3.0 type-cleanup
Milestone

Comments

@roji
Copy link
Member

roji commented Jun 27, 2019

In various place, we resolve methods on Queryable/Enumerable via name, and don't verify the exact number and type of parameters, assuming overloads will never be added. We should do a pass to compare against MethodInfo.

We already have LinqMethodHelpers which should contain all commonly-used MethodInfos - this should be used rather than looking up MethodInfos in various places. However, that class currently doesn't lookup in a bulletproof way, checking number of parameters but not types.

Original conversation: #16249 (comment)

  • InMemoryLinqOperatorProvider
@roji
Copy link
Member Author

roji commented Jun 29, 2019

Do after #16339 is merged to avoid conflict.

@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview7 Jul 2, 2019
@roji
Copy link
Member Author

roji commented Jul 14, 2019

Also move LinqMethodHelpers out of NavigationExpansion and consider making public for use by providers.

@roji
Copy link
Member Author

roji commented Jul 25, 2019

@smitpatel holding off on this as discussed, since you want to replace LinqMethodHelpers (otherwise let me know and I'll do this).

Regarding big switches like in QueryableMethodTranslatingExpressionVisitor, we could also do something like:

case nameof(Queryable.Any) when method == LinqMethodHelpers.QueryableAnyMethodInfo:

Giving the best of both worlds - a nice clean switch and a tight reference comparison with a MethodInfo that's obtained once in a central place (also less verbose than checking parameter count and types).

@smitpatel
Copy link
Contributor

That seems pretty. We can certainly do that. 👍

@roji
Copy link
Member Author

roji commented Jul 25, 2019

You want me to do that and tighten method lookup in LinqMethodHelpers or are you working on something on your own side?

@smitpatel
Copy link
Contributor

I will complete it.

@smitpatel smitpatel removed their assignment Jul 30, 2019
@smitpatel smitpatel removed this from the 3.0.0 milestone Jul 30, 2019
@smitpatel
Copy link
Contributor

blocked label -> Refactoring QueryableMethodProvider in nav expansion take 2.
Un-assigning myself - once that PR is merged, anyone can go through and make the logic more robust as needed.

@roji
Copy link
Member Author

roji commented Jul 30, 2019

I can do that once the PR is merged.

@roji roji self-assigned this Jul 30, 2019
@smitpatel smitpatel removed the blocked label Aug 2, 2019
@smitpatel smitpatel added this to the 3.0.0 milestone Aug 2, 2019
@smitpatel
Copy link
Contributor

Thanks @roji

roji added a commit that referenced this issue Aug 7, 2019
roji added a commit that referenced this issue Aug 8, 2019
roji added a commit that referenced this issue Aug 8, 2019
roji added a commit that referenced this issue Aug 8, 2019
roji added a commit that referenced this issue Aug 8, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0, Backlog Aug 14, 2019
@smitpatel smitpatel removed the query label Sep 3, 2019
@smitpatel
Copy link
Contributor

Isn't this done already?

@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Mar 16, 2020
@smitpatel smitpatel modified the milestones: Backlog, 3.1.0 Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. punted-for-3.0 type-cleanup
Projects
None yet
Development

No branches or pull requests

3 participants