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);
}