public void Query <T>(CustomQuery query, Action <IRestResponse <T> > callback = null) where T : INestedResults, new() { string queryResults = query.ToString(); string q = queryResults.Length > 0 ? "&" : "?"; queryResults += string.Format("{0}$inlinecount=allpages", q); string uri = string.Format("{0}{1}{2}", URI_TABLES, _name, queryResults); ZumoRequest request = new ZumoRequest(_client, uri, Method.GET); Debug.Log("Query Request: " + uri + " Query with inlinecount:" + queryResults); _client.ExecuteAsync <T> (request, callback); }
/* * public IEnumerator Query<T,N> (CustomQuery query, Action<IRestResponse<N>> callback = null) where N : INestedResults<T> where T : new() * { * string queryString = query.ToString (); * string q = queryString.Length > 0 ? "&" : "?"; * queryString += string.Format ("{0}$inlinecount=allpages", q); * string url = string.Format ("{0}/{1}{2}{3}", _client.AppUrl, URI_TABLES, _name, queryString); * Debug.Log ("Query Request: " + url + " Paginated Query:" + query); * ZumoRequest request = new ZumoRequest (_client, url, Method.GET); * yield return request.request.Send (); * request.TryParseJsonNestedArray<T,N> ("results", callback); * } */ public IEnumerator Query <T>(CustomQuery query, Action <IRestResponse <NestedResults <T> > > callback = null) where T : new() { string queryString = query.ToString(); string q = queryString.Length > 0 ? "&" : "?"; queryString += string.Format("{0}$inlinecount=allpages", q); string url = string.Format("{0}/{1}{2}{3}", _client.AppUrl, URI_TABLES, _name, queryString); Debug.Log("Query Request: " + url + " Paginated Query:" + query); ZumoRequest request = new ZumoRequest(_client, url, Method.GET); yield return(request.request.Send()); request.ParseJsonNestedArray <T, NestedResults <T> >("results", callback); }