[Fixes #3749] Expose ActionContext on IUrlHelper
This commit is contained in:
parent
dc968bc1bf
commit
1f87442092
|
|
@ -10,6 +10,11 @@ namespace Microsoft.AspNet.Mvc
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IUrlHelper
|
public interface IUrlHelper
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the <see cref="ActionContext"/> for the current request.
|
||||||
|
/// </summary>
|
||||||
|
ActionContext ActionContext { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generates a fully qualified or absolute URL specified by <see cref="UrlActionContext"/> for an action
|
/// Generates a fully qualified or absolute URL specified by <see cref="UrlActionContext"/> for an action
|
||||||
/// method, which contains action name, controller name, route values, protocol to use, host name, and fragment.
|
/// method, which contains action name, controller name, route values, protocol to use, host name, and fragment.
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,10 @@ namespace Microsoft.AspNet.Mvc.Routing
|
||||||
ActionContext = actionContext;
|
ActionContext = actionContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected RouteValueDictionary AmbientValues => ActionContext.RouteData.Values;
|
/// <inheritdoc />
|
||||||
|
public ActionContext ActionContext { get; }
|
||||||
|
|
||||||
protected ActionContext ActionContext { get; }
|
protected RouteValueDictionary AmbientValues => ActionContext.RouteData.Values;
|
||||||
|
|
||||||
protected HttpContext HttpContext => ActionContext.HttpContext;
|
protected HttpContext HttpContext => ActionContext.HttpContext;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -595,6 +595,8 @@ namespace Microsoft.AspNet.Mvc
|
||||||
_url = url;
|
_url = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ActionContext ActionContext { get; }
|
||||||
|
|
||||||
public object RouteValues { get; private set; }
|
public object RouteValues { get; private set; }
|
||||||
|
|
||||||
public string Action(UrlActionContext actionContext)
|
public string Action(UrlActionContext actionContext)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue