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

[TINY] Fix to #15763 - "collection selector was not NavigationExpansionExpression" when joining two FromSql()s #15963

Merged
merged 1 commit into from
Jun 8, 2019

Conversation

maumar
Copy link
Contributor

@maumar maumar commented Jun 5, 2019

Problem was that navigation expansion wasn't recognizing FromSqlOnQueryable as something that needs to be visited, so the expression was not being converted to NavigationExpansionExpression.
SelectMany requires collection navigation to be a NavigationExpansionExpression, hence the error.

@maumar maumar requested review from smitpatel and roji June 5, 2019 19:58
@maumar
Copy link
Contributor Author

maumar commented Jun 7, 2019

new version up

@maumar maumar force-pushed the fix15763 branch 2 times, most recently from 673f778 to 0c7b64f Compare June 7, 2019 18:59
// result is a sequence, no lambda arguments, exactly one generic argument corresponding to result sequence type
if (methodCallExpression.Object == null
&& resultSequenceType != null
&& methodCallExpression.Arguments.All(a => a.UnwrapQuote() == null)
Copy link
Member

Choose a reason for hiding this comment

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

Use a different function to identify if it is a lambda. UnwrapQuote needs to return LambdaExpression only, never null;

…ssion" when joining two FromSql()s

Problem was that navigation expansion wasn't recognizing FromSqlOnQueryable as something that needs to be visited, so the expression was not being converted to NavigationExpansionExpression.
SelectMany requires collection navigation to be a NavigationExpansionExpression, hence the error.
Fix is to add generic handling of simple queryable methods.
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