Catel.Services.NavigationService.ToQueryString C# (CSharp) Метод

ToQueryString() приватный статический Метод

Converts a dictionary to query string parameters.
This method uses the Object.ToString method to convert values to a parameter value. Make sure that the objects passed correctly support this.
private static ToQueryString ( object>.Dictionary parameters ) : string
parameters object>.Dictionary The parameters.
Результат string
        private static string ToQueryString(Dictionary<string, object> parameters)
        {
            string url = string.Empty;

            foreach (var parameter in parameters)
            {
                if (parameter.Value != null)
                {
                    if (string.IsNullOrEmpty(url))
                    {
                        url = "?";
                    }
                    else
                    {
                        url += "&";
                    }

                    url += string.Format("{0}={1}", HttpUtility.UrlEncode(parameter.Key), HttpUtility.UrlEncode(parameter.Value.ToString()));
                }
            }

            return url;
        }
#endif