Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public Url UpdateQuery(NameValueCollection queryString)
        {
            Url u = new Url(this);

            foreach (string key in queryString.AllKeys)
            {
                u = u.SetQueryParameter(key, queryString[key]);
            }
            return(u);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 public void UpdatingQueryToNull_WhenSingleParameter_RemovesItFromUrl()
 {
     Url u = new Url("/hello.aspx?something=someotherthing");
     u = u.SetQueryParameter("something", null);
     Assert.AreEqual("/hello.aspx", u.ToString());
 }
Esempio n. 5
0
 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());
 }
Esempio n. 6
0
 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());
 }
Esempio n. 7
0
 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;
 }
Esempio n. 8
0
 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;
 }
Esempio n. 9
0
 public Url UpdateQuery(NameValueCollection queryString)
 {
     Url u = new Url(this);
     foreach (string key in queryString.AllKeys)
         u = u.SetQueryParameter(key, queryString[key]);
     return u;
 }