I've got (what I think is a odata format) url like this:
http://localhost:2282/SSE.Web/History.cshtml?GetData=true&itemId=AKE-00129&pid=1&%24filter=indexof(ItemType%2C%27Attri%27)+ge+0&%24skip=0&%24top=50&%24inlinecount=allpages&_=1325589443808
what is interesting here is the $filter parameter. It has the format "indexof(ItemType,'Attri') ge 0"
The source is an grid (iggrid from infragistics) that is filtering on the ItemType column with text 'Attri'
My question is: Mapping the top and skip parameters was trivial, but how to do the filter. Do I need to parse it and build my own linq, or are there some other ways?
This is the code I have so far:
var skip = int.Parse(Request["$Skip"]);
var top = int.Parse(Request["$top"]);
var filter = Request(["$filter"]);
var db = Database.Open("SSEConnectionString");
var entries = db.Query("select * from eHistory order by timestamp desc")
Json.Write(new { results = entries.Where(????).Skip(skip).Take(top), totalRecCount = entries.Count() }, Response.Output);
Thanks for any help!
Larsi