I would like to query data given an array to filter by via WCF Data Services using the Silverlight Client API. Basically, I want to query Employees given a list (array) of States.
I'm thinking something like this:
public IQueryable<Employee> Load(string[] states)
{
foreach (var x in states)
{
// LINQ query here with 1 to N .Where statements
return from e in Context.Employees
.Where(...)
}
}
So let's say my array has 2 items in it, i.e. I want to query by 2 states, I would do something like this manually:
return from e in Context.Employees
.Where(e => e.State== states[0] || e.State == states[1])));
Any advice will be greatly appreciated!