Strange behavior in Uri-class (.NET)

Why does the Uri class urldecode my url that I send to its contructor and how can I prevent this?

Example (look at the querystring value "options"):

    string url = "";
    Uri uri = new Uri(url); //


// ?id=1&name=andreas&options=one%3d1%26two%3d2%26three%3d3
Request.QueryString["options"] = one=1&two=2&three=3

// ?id=1&name=andreas&options=one=1&two=2&three=3
Request.QueryString["options"] = one=1

This is my problem :)


why exactly? you can get to the encoded version using url.AbsoluteUri


Console.WriteLine("1) " + uri.AbsoluteUri);
Console.WriteLine("2) " + uri.Query);

2) ?id=1&name=andreas&options=one%3d1%26two%3d2%26three%3d3

Need Your Help

Implicit resolution for different orders of case class and companion

scala implicit case-class companion-object context-bound

Usually, I write first a case class and then the companion object in the same file, right below. But when trying to import an implicit declared in the companion, I'm forced to switch the order of