private static Uri CreateRedirectHttp(Uri uri, RouteValueDictionary parameters, string responseMode) { return(responseMode switch { ResponseModes.Fragment => uri.AddParametersInFragment(parameters), _ => uri.AddParametersInQuery(parameters) });
public static RedirectResult CreateRedirectHttpTokenResponse( this Uri uri, RouteValueDictionary parameters, string responseMode) { switch (responseMode) { case ResponseModes.Fragment: uri = uri.AddParametersInFragment(parameters); break; case ResponseModes.Query: uri = uri.AddParametersInQuery(parameters); break; case ResponseModes.None: break; case ResponseModes.FormPost: break; default: throw new ArgumentOutOfRangeException(nameof(responseMode), responseMode, null); } return(new RedirectResult(uri.AbsoluteUri)); }
/// <summary> /// Create a redirection HTTP response message based on the response mode. /// </summary> /// <param name="controller"></param> /// <param name="uri"></param> /// <param name="parameters"></param> /// <param name="responseMode"></param> /// <returns></returns> public static string CreateRedirectHttp( this Controller controller, Uri uri, RouteValueDictionary parameters, ResponseMode responseMode) { switch (responseMode) { case ResponseMode.fragment: uri = uri.AddParametersInFragment(parameters); break; default: uri = uri.AddParametersInQuery(parameters); break; } return(uri.ToString()); }
public static RedirectResult CreateRedirectHttpTokenResponse( this Controller controller, Uri uri, RouteValueDictionary parameters, ResponseMode responseMode) { switch (responseMode) { case ResponseMode.fragment: uri = uri.AddParametersInFragment(parameters); break; case ResponseMode.query: uri = uri.AddParametersInQuery(parameters); break; } return(new RedirectResult(uri.AbsoluteUri)); }