public string ToString(bool containsNullOrWhiteSpace)
        {
            return(StringUtils.AddPrefix(string.Join(HttpUtility2.QueryValuesDelimiter, this.Where(p =>
            {
                if (containsNullOrWhiteSpace == false)
                {
                    if (string.IsNullOrWhiteSpace(p.Key) == true || string.IsNullOrWhiteSpace(p.Value) == true)
                    {
                        return false;
                    }
                }

                return true;
            })), HttpUtility2.QuerySeparator));
        }
예제 #2
0
        public string ToString(bool prefix, bool containsNullOrWhiteSpace)
        {
            var toString = string.Join(HttpUtility2.QueryValuesDelimiter, this.Where(p =>
            {
                if (containsNullOrWhiteSpace == false)
                {
                    if (string.IsNullOrWhiteSpace(p.Key) == true || string.IsNullOrWhiteSpace(p.Value) == true)
                    {
                        return(false);
                    }
                }

                return(true);
            }));

            if (prefix == true)
            {
                return(StringUtils.AddPrefix(toString, HttpUtility2.QuerySeparator));
            }
            else
            {
                return(toString);
            }
        }