private static MobileServiceTableQueryDescription Compile <T, U>(Func <IMobileServiceTable <T>, MobileServiceTableQuery <U> > getQuery) { MobileServiceClient service = new MobileServiceClient("http://www.test.com"); IMobileServiceTable <T> table = service.GetTable <T>(); MobileServiceTableQuery <U> query = getQuery(table); MobileServiceTableQueryDescription odata = query.Compile(); App.Harness.Log(">>> " + odata.ToString()); return(odata); }
public void CombinedQuery() { MobileServiceTableQueryDescription odata = Compile((IMobileServiceTable <Product> table) => (from p in table where p.Price <= 10M && p.Weight > 10f where !p.InStock orderby p.Price descending orderby p.Name select new { p.Name, p.Price }) .Skip(20) .Take(10)); Assert.AreEqual( "$filter=((Price le 10M) and (Weight gt 10f)) and not(InStock)&$orderby=Price desc,Name&$skip=20&$top=10&$select=Name,Price", odata.ToString()); }