-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Improve exception message text for queries that create new collections in projection #23707
Improve exception message text for queries that create new collections in projection #23707
Comments
@smitpatel Can we fix this for 5.0? |
No. |
@smitpatel Okay, then we'll need to document it as a breaking change. |
Exception message covers what needs to be done. |
@smitpatel It's still a breaking change |
So a documented breaking change which user cannot utilize to find actual queries which would cause the issue, requiring the user to run the query which throws exception and evaluate the exception to figure out they actual hit the breaking change and take necessary action for the breaking change which is same as what is written in the error message. I don't see how it adds any value to any user. I am not gonna fight over this. @maumar - Can you add this "breaking change"? |
@smitpatel The documentation sets up some expectations for users planning to upgrade. It also provides some background and could prevent more issues being filed about it. |
Why was this closed? The bug has not been fixed yet, only the breaking change has been documented. I think this either needs to be fixed in a future version or the error message needs to change because it is wrong: My code is doing what the error message suggests as a fix ("or some other mechanism"), so it should not be thrown in the first place. |
Hi guys,
I think in our situation EF core does not like the use of let keywords, we have a lot of code like the one above where we used to use let in EF6 and that did great for reusability and readability of statements in "current" query. Is this pattern totally not supported in EF core or is it result of the change mentioned in the topic ? |
@Mani4k Please open a new issue and attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate. |
@ajcvickers Can you reopen this issue? |
@bart-degreed Agreed after re-reading the exception message that it could be interpreted to include what your code does. I will re-open to consider making it clear in the message that this isn't supported. |
When running the repro code below in EF Core 5 RC1 (v5.0.0-rc.1.20451.13), it produces the next error message:
When running in EF Core v3.1.8, it succeeds without error.
Repro code:
I believe that the "or some other mechanism" in the error message should allow the
new HashSet<ArticleTag>(...)
expression, which it fails to take into account. When replacing that with.ToHashSet()
then the error goes away. But earlier versions of EF Core 3.x were unable to understand the.ToHashSet()
call, which is why I'm using constructor syntax.The text was updated successfully, but these errors were encountered: