public Url UpdateQuery(IDictionary <string, string> queryString) { Url u = new Url(this); foreach (KeyValuePair <string, string> pair in queryString) { u = u.SetQueryParameter(pair.Key, pair.Value); } return(u); }
public Url UpdateQuery(NameValueCollection queryString) { Url u = new Url(this); foreach (string key in queryString.AllKeys) { u = u.SetQueryParameter(key, queryString[key]); } return(u); }
public Url UpdateQuery(IDictionary <string, object> queryString) { Url u = new Url(this); foreach (KeyValuePair <string, object> pair in queryString) { if (pair.Value != null) { u = u.SetQueryParameter(pair.Key, pair.Value.ToString()); } } return(u); }
public void UpdatingQueryToNull_WhenSingleParameter_RemovesItFromUrl() { Url u = new Url("/hello.aspx?something=someotherthing"); u = u.SetQueryParameter("something", null); Assert.AreEqual("/hello.aspx", u.ToString()); }
public void UpdatingQueryToNull_ReturnsOtherParameter_WhenUpdatingSecond() { Url u = new Url("/hello.aspx?something=someotherthing&query=value"); u = u.SetQueryParameter("query", null); Assert.AreEqual("/hello.aspx?something=someotherthing", u.ToString()); }
public void UpdatingQueryToNull_ReturnsOtherParameters_WhenUpdatingFirst() { Url u = new Url("/hello.aspx?something=someotherthing&query=value&query3=value3"); u = u.SetQueryParameter("something", null); Assert.AreEqual("/hello.aspx?query=value&query3=value3", u.ToString()); }
public Url UpdateQuery(IDictionary<string, object> queryString) { Url u = new Url(this); foreach (KeyValuePair<string, object> pair in queryString) if (pair.Value != null) u = u.SetQueryParameter(pair.Key, pair.Value.ToString()); return u; }
public Url UpdateQuery(IDictionary<string, string> queryString) { Url u = new Url(this); foreach (KeyValuePair<string, string> pair in queryString) u = u.SetQueryParameter(pair.Key, pair.Value); return u; }
public Url UpdateQuery(NameValueCollection queryString) { Url u = new Url(this); foreach (string key in queryString.AllKeys) u = u.SetQueryParameter(key, queryString[key]); return u; }