Hi,
I have a C#.NET Silverlight 3.0 client running RIA Services with an EF model. I'm trying to set up an advanced search system on the client such that the user can say, I want field (property) "Foo1" to have value "Bar1," etc.. .
I'd like to use a flexible, dynamic approach similar to this one. The problem is I can't pass IQueryable as a ServiceOperation parameter or as a domain service parameter. I.E. This doesn't work:
[ServiceOperation()]
public int GetFooCount(string category, IQueryable<Foo> search)
{
int fooCount;
if (search != null)
{
IQueryable<Foo> filteredFooSet = this.Context.FooSet.Intersect(search);
fooCount = (from foo in filteredFooSet
where foo.Category == category
select foo).Count();
}
else
{
fooCount = (from foo in this.Context.ContactSet
where foo.Category == category
select foo).Count();
}
return fooCount;
}
Can anyone suggest either a way to get this approach to work or an alternative (better) approach? The objective is a flexible search control that can be applied to more than any single specific entity type.