Created
November 6, 2018 21:03
-
-
Save czenzel/b553bd34089e335b3da049f68a08a0a1 to your computer and use it in GitHub Desktop.
Simple Combine Key-Value Dictionary to Query String Parameters (WIP: Could use improvements)
This file contains 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 class Extensions | |
{ | |
public static string CombineToQuerystring(this Dictionary<string, string> Components) | |
{ | |
List<string> objStrings = new List<string>(); | |
foreach (var objParam in Components) | |
objStrings.Add(string.Format(@"{0}={1}", objParam.Key, objParam.Value)); | |
return string.Join("&", objStrings.ToArray()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment