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

Specific message for method translation failure #21178

Merged
merged 2 commits into from
Jun 9, 2020
Merged

Conversation

roji
Copy link
Member

@roji roji commented Jun 8, 2020

Closes #21177

@roji roji requested review from smitpatel and maumar June 8, 2020 14:34
@roji roji force-pushed the MethodTranslationMessage branch from c530a3c to 2589734 Compare June 9, 2020 11:02
@roji roji merged commit 40c7f01 into master Jun 9, 2020
@roji roji deleted the MethodTranslationMessage branch June 9, 2020 12:09
Assert.Equal(
@"The LINQ expression 'DbSet<CollectionScalar>() .Where(c => c.Tags .Any())' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.",
Assert.Contains(
@"Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.",
Copy link
Member

Choose a reason for hiding this comment

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

This was by design. We should verify exception message for query as much as we can with Equal so that we know exactly what we are printing as Expression tree to user.

Copy link
Member Author

Choose a reason for hiding this comment

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

We were already checking only a substring via QueryTestBase.AssertTranslationFailed, and @maumar seemed to think this change was OK. Strong feelings about this?

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.

Helpful exception message for method translation failure
4 participants