I have a WCF Data Service and it gets its data from dinamically created objects, like this:
List<UObject> list=new List<UObject>();
for(int i=0;i<20;i++)
{
list.Add(new UObject());
}
For the clients it has to be accessible as a queryable method, so I use this code:
[WebGet]
public IQueryable<UObject> GetObjects()
{
return list.Where(e=>e.Item>=2).AsQeryable<UObject>();
}
The problem is that the objects are in a List and it cannot be queried with Take or Skip commands, it simply returns the entire IEnumerable (I presume).
So when I call it from an Android client:
consumer.callFunction("GetObjects").top(10).execute();
I get the following exception:
org.odata4j.exceptions.BadRequestException: Query options $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource.
How should I implement a queryable list? Is it possible or I can use it only against Entity Framework DbSets?