public ActionResult ExternalLogin(string provider, string returnUrl)
        {
            var authProvier = _providers[provider.ToLowerInvariant()];
            var action      = Url.Action("ExternalLoginCallback");
            var callback    = new Uri(Url.Public(action), UriKind.Absolute);

            Session["ReturnUrl"] = returnUrl;

            authProvier.RequestAuthentication(HttpContext, callback.AddQueryParameter("provider", provider));

            // Show not get here.
            return new EmptyResult();
        }
 public void Add_Query_Parameter_With_Query_Before()
 {
     Uri uri = new Uri("http://address.url/path/to/page.asp?query=value");
     Assert.AreEqual("http://address.url/path/to/page.asp?query=value&added=value", uri.AddQueryParameter("added", "value").ToString());
 }
 public void Change_Parameter()
 {
     Uri uri = new Uri("http://address.url/path/to/page.asp?query=value");
     Uri uri2 = new Uri("http://address.url/path/to/page.asp?query=value2");
     Assert.AreEqual(uri2,uri.AddQueryParameter("query", "value2"));
 }
 public void Add_Parameter_Null_Key()
 {
     Uri uri = new Uri("http://address.url/path/to/page.asp?query=value");
     uri.AddQueryParameter(null, "val");
 }