Open Hasanchiver opened 4 years ago
Hi, Hasanchiver
It seems you can use the query string like ~/Orders?$filter=SubOrders/$count eq 2
. However, it's not supported yet in OData library, Neither for ASP.NET Core OData.
There's a PR #1336 related to this feature which is under reviewing. Once that PR get merged, we can work this feature in ASP.NET Core.
Any workaround?
I am having trouble writing a query for filtering by count of a child collection. I have two types of entities.
Assemblies affected
Microsoft.AspNetCore.OData 7.3.0
Reproduce steps
I have two types of entities: Orders and Suborders. Orders contain a list of Suborders. I want to query for an Order with exactly 2 Suborders or exactly 3 Suborders. How should I write my query? I haven't been able to find anything online for this within the past 24 hours.