Unity3dAzure.AppServices.CustomQuery.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
        public override string ToString()
        {
            string queryString = "";
            string q = "?";
            if (!string.IsNullOrEmpty (this.Filter)) {
                queryString += string.Format ("{0}$filter=({1})", q, this.Filter);
                q = "&";
            }
            if (!string.IsNullOrEmpty (this.OrderBy)) {
                queryString += string.Format ("{0}$orderby={1}", q, this.OrderBy);
                q = "&";
            }
            if (this.Top > 0) {
                queryString += string.Format ("{0}$top={1}", q, this.Top.ToString ());
                q = "&";
            }
            if (this.Skip > 0) {
                queryString += string.Format ("{0}$skip={1}", q, this.Skip.ToString ());
                q = "&";
            }
            if (!string.IsNullOrEmpty (this.Select)) {
                queryString += string.Format ("{0}$select={1}", q, this.Select);
                q = "&";
            }
            if (this.SystemProperties != MobileServiceSystemProperty.nil) {
                // NB: setting __systemproperties param doesn't seem to do anything different as these properties are all included by default, but we can append values to the 'select' param.
                if (!string.IsNullOrEmpty (this.Select)) {
                    queryString += string.Format (",{0}", SystemPropertiesValues (this.SystemProperties));
                }
                queryString += string.Format ("{0}__systemproperties={1}", q, SystemPropertiesValues (this.SystemProperties));
                q = "&";
            }
            if (this.IncludeDeleted) {
                queryString += string.Format ("{0}__includeDeleted=true", q);
            }
            return EscapeURL (queryString);
        }

Usage Example

        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);
        }
All Usage Examples Of Unity3dAzure.AppServices.CustomQuery::ToString