Exemplo n.º 1
0
 public new IEnumerator <KeyValuePair <string, string> > GetEnumerator()
 {
     return(AllKeys.SelectMany(GetValues, (k, c) => new KeyValuePair <string, string>(k, c)).ToList().GetEnumerator());
 }
 /// <summary>
 /// Converts the content of this instance to its equivalent string representation.
 /// </summary>
 /// <returns>The string representation of the value of this instance, multiple values with a single key are comma separated.</returns>
 public override string ToString()
 {
     return(String.Concat("?", GroupByCommaSeparatedValues
         ? String.Join("&", AllKeys.Select(key => new { key, value = GetValues(key).Aggregate((s, next) => String.Concat(s, ",", next)) }).Select(pair => String.Join("=", pair.key, Uri.EscapeDataString(pair.value))))
         : String.Join("&", AllKeys.SelectMany(GetValues, (key, value) => String.Join("=", key, Uri.EscapeDataString(value))))));
 }