Created
July 21, 2017 15:39
Revisions
-
nozzlegear created this gist
Jul 21, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ namespace MyNamespace { public static class Extensions { public List<KeyValuePair<string, StringValues>> ToKvps(this System.Collections.Specialized.NameValueCollection qs) { Dictionary<string, string> parameters = qs.Keys.Cast<string>().ToDictionary(key => key, value => qs[value]); var kvps = new List<KeyValuePair<string, StringValues>>(); parameters.ToList().ForEach(x => { kvps.Add(new KeyValuePair<string, StringValues>(x.Key, new StringValues(x.Value))); }); return kvps; } } }