OData Web API v5.5 supports nested $filter in $expand, e.g.:
.../Customers?$expand=Orders($filter=Id eq 10)
POCO classes:
With Edm model built as follows:
To Map route,
- For Microsoft.AspNet.OData, e.g., in
WebApiConfig.cs
:
- For Microsoft.AsnNetCore.OData, e.g., in
Startup.Configure((IApplicationBuilder app, IHostingEnvironment env)
method:
Controller:
Request:
http://localhost:port_number/orest/Customers?$expand=Orders($filter=Id eq 10)
Response: