/// <summary> /// Converts <see cref="ConfigurationSettingsCollection" /> to the list. /// </summary> /// <returns>The list.</returns> public IList <string> ToList() { return(AllKeys.Select(key => Get(key)).ToList()); }
public string ToQueryString() { var queryStringParameters = AllKeys.Select(key => $"{key}={HttpUtility.UrlEncode(this[key])}").ToList(); return(string.Join("&", queryStringParameters.ToArray())); }
public IEnumerable <string> GetErrors() { return(AllKeys.Select(key => this[key])); }
public override String ToString() { return(string.Join("&", AllKeys.Select(k => $"{k}={this[k]}"))); }
/// <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)))))); }