-
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
"The query has been configured to use 'QuerySplittingBehavior.SplitQuery' and contains a collection in the 'Select' call" #22868
Comments
I just updated to 5 RC1 to test it out in our application and I'm hitting this one a lot. var result = context.Products.Select(p => new ProductDto
{
Name = p.Name,
Rates = p.Ratings.Select(r => new RatingDto { Rate = r.Rate }).ToList(),
}).ToList(); My expectation was that setting I got the exception, but at this point I have choose between changing all the queries (that will just fail at runtime) and add Am I missing something? |
Duplicate of #21234 |
@smitpatel |
@smitpatel Could you please answer my question 👆 I'd appreciate it |
Follow #21234 for updates. That issue is in backlog milestone hence it is not going to happen for 5.0. We will consider it for next release. |
Okay, sounds great, it'd be awesome if it'll be added in the next release. Thanks. |
I am really upset by this. I have been waiting ever since 2.2 for AsSplitQuery. And now that it's here, it can't handle the use case where it's needed! I fetch a deep object graph off my Trip object with the following includes: { 2.2 did it fast. 3.0. 3.1 and 5.0 use tons of memory and take a minute. SplitQuery wont process it. Am I supposed to hand code all of the parts of assembling this tree? What's the point of an ORM then? Why did you remove this feature and not add back any compatibility? |
Please tell me if this is a duplicate, but:
I want to avoid the "Cartesian Explosion Problem", I noticed that EF Core 5.0 has now the option to enable "split queries".
However, I found out that it's not possible to use split queries when collections are projected:
This would cause the following exception to be thrown:
Why isn't this possible? It seems perfectly reasonable!
I'm not sure but I believe this used to work in EF Core 2.x
Will this be implemented? It is very much needed! Thank you!
Provider and version information:
EF Core version: 5.0.0 RC1
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 5.0
The text was updated successfully, but these errors were encountered: