Using Linq to filter parents by their children

Posted by Nick L on Stack Overflow See other posts from Stack Overflow or by Nick L
Published on 2010-12-21T22:52:16Z Indexed on 2010/12/21 22:54 UTC
Read the original article Hit count: 155

Filed under:
|
|

Having some problems with my Silverlight app (with RIA services) filtering my results. The idea is on the client I set up the EntityQuery and its filters and call load. However this isn't working for me.

Heres my code.

public void FireQuery(string filterValue)
{
    EntityQuery<Parent> query = m_ParentDomainContext.GetParentQuery();
    query = query.Where(p => p.Children.Any(c => c.Name.Contains(filterValue)));
    m_ParentDomainContext.Load(query, Query_Completed, null);
}

Compiles just fine, however, runtime I get "Query operator 'Any' is not supported." Exception. Does anyone know of a good way to filter like this? Again, I'm looking for a way to set this up on the client.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about LINQ