Linq OData “Where” clause on nested list?

The short answer is that it's not possible currently. The $filter always (and only) applies to the top-level entity set. There's currently no way to filter expanded entity sets.

The $filter can reach inside the expanded entity sets but the result will always filter the top-level set. In V2 it works for singleton navigation properties (the expression in $filter can traverse those), in V3 you can use the any/all to also incorporate collection navigation properties The reason this can't work is that the OData protocol doesn't define the URI syntax for nested filters. In fact it doesn't define almost any operator on the expanded entity sets except for the expansion itself and projections.

The short answer is that it's not possible currently. The $filter always (and only) applies to the top-level entity set. There's currently no way to filter expanded entity sets.

The $filter can reach inside the expanded entity sets but the result will always filter the top-level set. In V2 it works for singleton navigation properties (the expression in $filter can traverse those), in V3 you can use the any/all to also incorporate collection navigation properties. The reason this can't work is that the OData protocol doesn't define the URI syntax for nested filters.In fact it doesn't define almost any operator on the expanded entity sets except for the expansion itself and projections.

– Vaccano Oct 5 at 16:11 No, I said that any/all will be supported which allows you to filter the top-level set based on content of the expanded sets. But it still doesn't allow you to filter the expanded sets. – Vitek Karas MSFT Oct 5 at 20:03 Ok, thanks.

Really what I need is what you have described (filtering top level items based on content of expanded sets). Thanks! – Vaccano Oct 6 at 15:50 Is the release of OData V3 attached to Visual Studio 11?

(Is that something you can even talk about? ) – Vaccano Oct 6 at 15:51 I can't talk exact dates yet (sorry). We have a CTP with support for any/all (blogs.msdn.

Com/b/astoriateam/archive/2011/06/30/…). You can try it with that. – Vitek Karas MSFT Oct 6 at 16:48.

The reason this can't work is that the OData protocol doesn't define the URI syntax for nested filters. In fact it doesn't define almost any operator on the expanded entity sets except for the expansion itself and projections.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions