Currently, there isn't one available that I'm aware of.
It's easy enough to create something that mirrors the original .NET functionality:
public static class UriExtensions
{
public static Uri CreateUriWithQuery(Uri uri, NameValueCollection values)
{
var queryStr = new StringBuilder();
// presumes that if there's a Query set, it starts with a ?
var str = string.IsNullOrWhiteSpace(uri.Query) ?
"" : uri.Query.Substring(1) + "&";
foreach (var value in values)
{
queryStr.Append(str + value.Key + "=" + value.Value);
str = "&";
}
// query string will be encoded by building a new Uri instance
// clobbers the existing Query if it exists
return new UriBuilder(uri)
{
Query = queryStr.ToString()
}.Uri;
}
}
public class NameValueCollection : Dictionary<string, string>
{
}
Using like:
var uri = UriExtensions.CreateUriWithQuery(new Uri("http://example.com"),
new NameValueCollection { { "key1", "value1" }, { "key2", "value2" }});
Results:
http://localhost/?key1=value1&key2=value2