I have the following method that I use to traverse collections like IQueryCollection, IHeadersDictionary and IFormCollection
public static string ToString(IEnumerable<KeyValuePair<string, StringValues>> dic)
{
string res = "";
foreach (var item in dic)
{
res += item.Key + "=" + item.Value + "&";
}
return res.TrimEnd('&');
}
I was wondering if it would be possible to do it in a more " functional" style, using something like Select and String.Join method
I'm using dot-net-core 2.0