Merge branch 'merge/release/2.2-to-master'
# Conflicts: # build/dependencies.props
This commit is contained in:
commit
dfaaa2ef5d
|
|
@ -9,13 +9,13 @@ using Microsoft.Extensions.Logging;
|
||||||
namespace Microsoft.AspNetCore.Mvc.Routing
|
namespace Microsoft.AspNetCore.Mvc.Routing
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An implementation of <see cref="IUrlHelper"/> that uses <see cref="ILinkGenerator"/> to build URLs
|
/// An implementation of <see cref="IUrlHelper"/> that uses <see cref="LinkGenerator"/> to build URLs
|
||||||
/// for ASP.NET MVC within an application.
|
/// for ASP.NET MVC within an application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class DispatcherUrlHelper : UrlHelperBase
|
internal class DispatcherUrlHelper : UrlHelperBase
|
||||||
{
|
{
|
||||||
private readonly ILogger<DispatcherUrlHelper> _logger;
|
private readonly ILogger<DispatcherUrlHelper> _logger;
|
||||||
private readonly ILinkGenerator _linkGenerator;
|
private readonly LinkGenerator _linkGenerator;
|
||||||
private readonly IEndpointFinder<RouteValuesBasedEndpointFinderContext> _routeValuesBasedEndpointFinder;
|
private readonly IEndpointFinder<RouteValuesBasedEndpointFinderContext> _routeValuesBasedEndpointFinder;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -26,12 +26,12 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
||||||
/// <param name="routeValuesBasedEndpointFinder">
|
/// <param name="routeValuesBasedEndpointFinder">
|
||||||
/// The <see cref="IEndpointFinder{T}"/> which finds endpoints by required route values.
|
/// The <see cref="IEndpointFinder{T}"/> which finds endpoints by required route values.
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="linkGenerator">The <see cref="ILinkGenerator"/> used to generate the link.</param>
|
/// <param name="linkGenerator">The <see cref="LinkGenerator"/> used to generate the link.</param>
|
||||||
/// <param name="logger">The <see cref="ILogger"/>.</param>
|
/// <param name="logger">The <see cref="ILogger"/>.</param>
|
||||||
public DispatcherUrlHelper(
|
public DispatcherUrlHelper(
|
||||||
ActionContext actionContext,
|
ActionContext actionContext,
|
||||||
IEndpointFinder<RouteValuesBasedEndpointFinderContext> routeValuesBasedEndpointFinder,
|
IEndpointFinder<RouteValuesBasedEndpointFinderContext> routeValuesBasedEndpointFinder,
|
||||||
ILinkGenerator linkGenerator,
|
LinkGenerator linkGenerator,
|
||||||
ILogger<DispatcherUrlHelper> logger)
|
ILogger<DispatcherUrlHelper> logger)
|
||||||
: base(actionContext)
|
: base(actionContext)
|
||||||
{
|
{
|
||||||
|
|
@ -94,6 +94,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
||||||
});
|
});
|
||||||
|
|
||||||
var successfullyGeneratedLink = _linkGenerator.TryGetLink(
|
var successfullyGeneratedLink = _linkGenerator.TryGetLink(
|
||||||
|
ActionContext.HttpContext,
|
||||||
endpoints,
|
endpoints,
|
||||||
valuesDictionary,
|
valuesDictionary,
|
||||||
AmbientValues,
|
AmbientValues,
|
||||||
|
|
@ -128,6 +129,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
||||||
});
|
});
|
||||||
|
|
||||||
var successfullyGeneratedLink = _linkGenerator.TryGetLink(
|
var successfullyGeneratedLink = _linkGenerator.TryGetLink(
|
||||||
|
ActionContext.HttpContext,
|
||||||
endpoints,
|
endpoints,
|
||||||
valuesDictionary,
|
valuesDictionary,
|
||||||
AmbientValues,
|
AmbientValues,
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
||||||
if (endpointFeature?.Endpoint != null)
|
if (endpointFeature?.Endpoint != null)
|
||||||
{
|
{
|
||||||
var services = httpContext.RequestServices;
|
var services = httpContext.RequestServices;
|
||||||
var linkGenerator = services.GetRequiredService<ILinkGenerator>();
|
var linkGenerator = services.GetRequiredService<LinkGenerator>();
|
||||||
var routeValuesBasedEndpointFinder = services.GetRequiredService<IEndpointFinder<RouteValuesBasedEndpointFinderContext>>();
|
var routeValuesBasedEndpointFinder = services.GetRequiredService<IEndpointFinder<RouteValuesBasedEndpointFinderContext>>();
|
||||||
var logger = services.GetRequiredService<ILogger<DispatcherUrlHelper>>();
|
var logger = services.GetRequiredService<ILogger<DispatcherUrlHelper>>();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue