Created
July 22, 2017 19:28
-
-
Save davidvesely/7765df0e861bff2992a62777c1386247 to your computer and use it in GitHub Desktop.
Convert NameValueCollection to query string
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 characters
| public static string ConvertToQueryString(NameValueCollection queryParameters) | |
| { | |
| return string.Join("&", queryParameters.AllKeys | |
| .Select(a => $"{HttpUtility.UrlEncode(a)}={HttpUtility.UrlEncode(queryParameters[a])}")); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment