I have Web API endpoint which expects a list of enum values. I am using HttpUtility.ParseQueryString to generate the query string where I want to pass multiple key-value pair in the query string as below,
../api/getdata?myEnum=One&myEnum=Two&myEnum=Three
But, the ParseQueryString is creating the query string url as below,
../api/getdata?myEnum=One%2cTwo%2cThree
Here is my code,
var queryString = System.Web.HttpUtility.ParseQueryString(string.Empty);
queryString.Add("myEnum", "One");
queryString.Add("myEnum", "Two");
queryString.Add("myEnum", "Three");
How can I create the expected query string url with duplicate keys.
../api/getdata?myEnum=One&myEnum=Two&myEnum=Three