-
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
System.ArgumentException when using synchronuous LINQ aggregate methods in async GroupBy selection #12849
Comments
@orobert91 Can you please also post the entity types used, since the specific layout of navigation properties, etc. may impact our ability to reproduce the behavior you are seeing. |
@ajcvickers You should be able to reproduce it with the same example that @smitpatel made for #12852 by changing the inner |
Just stumbled upon the same exception in one of my projects but my query is slightly different. The issue is very easy to reproduce. var query = Context.ProductGroups
.Select(g => new
{
g.Id,
Products = g.Products.ToList()
})
.GroupBy(g => g.Id);
query.ToList(); // works
await query.ToListAsync(); // throws ArgumentException Github: GroupBy_Issues_Demos.cs |
We experience the same issue. Very weird.
|
This issue is tracking bug in pipeline when after doing group by, whole group is being materialized. That requires client eval of group by (i.e. what happened in 2.x release). Since 3.0 does not support this, the issue is no longer relevant. Implicitly client eval'ing group by is being tracked at #17068, if we ever fixed that, we will support this scenario too. |
OrderByDescending
within theSelect
clause causes EF Core 2.1 to crash:Exception within EF Core:
System.ArgumentException: 'Expression of type 'System.Collections.Generic.IAsyncEnumerable1[Sitka.WebApp.Server.Core.Domain.Inventory.InventoryEntry]' cannot be used for parameter of type 'System.Collections.Generic.IEnumerable1[Sitka.WebApp.Server.Core.Domain.Inventory.InventoryEntry]' of method 'System.Collections.Generic.List1[Sitka.WebApp.Server.Core.Domain.Inventory.InventoryEntry] ToList[InventoryEntry](System.Collections.Generic.IEnumerable1[Sitka.WebApp.Server.Core.Domain.Inventory.InventoryEntry])'
'While the following LINQ expression (with no
OrderByDescending
) does not throw:Stack Trace:
The text was updated successfully, but these errors were encountered: