using System;
using System.Web;
namespace WebsitePanel.WebDavPortal.Extensions
{
public static class UriExtensions
{
///
/// Adds the specified parameter to the Query String.
///
///
/// Name of the parameter to add.
/// Value for the parameter to add.
/// Url with added parameter.
public static Uri AddParameter(this Uri url, string paramName, string paramValue)
{
var uriBuilder = new UriBuilder(url);
var query = HttpUtility.ParseQueryString(uriBuilder.Query);
query[paramName] = paramValue;
uriBuilder.Query = query.ToString();
return new Uri(uriBuilder.ToString());
}
}
}