Reputation: 868
I have below OData query:
http://myApp/odata/Suppliers?$expand=SkillTasks($filter=TaskId eq 14)&$select=Id,Name
I get all Suppliers. Included SkillTasks are with Id=14 only or empty if given Supplier doesn't have SkillTask with Id=14.
What I expect is: only Suppliers having SkillTask with Id=14. If given Supplier doesn't have SkillTask with Id=14 he/she shouldn't be returned.
I think I should use filter on Supplier instead on SkillTasks but I dont know how to reference to SkillTask there
http://myApp/odata/Suppliers?$filter=(SkillTasks.TaskId eq 14)&$expand=SkillTasks&$select=Id,Name
Upvotes: 0
Views: 581
Reputation: 20605
I would expect that $filter
inside $expand
will work but you can use $filter
with any
operator.
http://myApp/odata/Suppliers?$expand=SkillTasks&$filter=SkillTasks/any(r:r/TaskId eq 14)&$select=Id,Name
Upvotes: 1