React to routing API review (#8194)

This commit is contained in:
James Newton-King 2018-08-02 13:37:43 +12:00 committed by GitHub
parent c34830f9de
commit 44f5b54f5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 14 deletions

View File

@ -48,8 +48,8 @@
<MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>
<MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>
<MicrosoftAspNetCoreResponseCachingPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreResponseCachingPackageVersion>
<MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>
<MicrosoftAspNetCoreRoutingPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreRoutingPackageVersion>
<MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>2.2.0-a-preview1-routing-api-review-p1-16821</MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>
<MicrosoftAspNetCoreRoutingPackageVersion>2.2.0-a-preview1-routing-api-review-p1-16821</MicrosoftAspNetCoreRoutingPackageVersion>
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreServerKestrelPackageVersion>
<MicrosoftAspNetCoreSessionPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreSessionPackageVersion>

View File

@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ActionConstraints;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Matchers;
using Microsoft.AspNetCore.Routing.Matching;
using Microsoft.AspNetCore.Routing.Metadata;
using Microsoft.AspNetCore.Routing.Patterns;
using Microsoft.AspNetCore.Routing.Template;

View File

@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ActionConstraints;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Matchers;
using Microsoft.AspNetCore.Routing.Matching;
using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Mvc.Routing

View File

@ -3,7 +3,6 @@
using System;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.EndpointFinders;
using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Mvc.Routing
@ -16,7 +15,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
{
private readonly ILogger<EndpointRoutingUrlHelper> _logger;
private readonly LinkGenerator _linkGenerator;
private readonly IEndpointFinder<RouteValuesBasedEndpointFinderContext> _routeValuesBasedEndpointFinder;
private readonly IEndpointFinder<RouteValuesAddress> _routeValuesBasedEndpointFinder;
/// <summary>
/// Initializes a new instance of the <see cref="EndpointRoutingUrlHelper"/> class using the specified
@ -30,7 +29,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
/// <param name="logger">The <see cref="ILogger"/>.</param>
public EndpointRoutingUrlHelper(
ActionContext actionContext,
IEndpointFinder<RouteValuesBasedEndpointFinderContext> routeValuesBasedEndpointFinder,
IEndpointFinder<RouteValuesAddress> routeValuesBasedEndpointFinder,
LinkGenerator linkGenerator,
ILogger<EndpointRoutingUrlHelper> logger)
: base(actionContext)
@ -87,7 +86,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
}
var endpoints = _routeValuesBasedEndpointFinder.FindEndpoints(
new RouteValuesBasedEndpointFinderContext()
new RouteValuesAddress()
{
ExplicitValues = valuesDictionary,
AmbientValues = AmbientValues
@ -124,7 +123,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
var valuesDictionary = routeContext.Values as RouteValueDictionary ?? GetValuesDictionary(routeContext.Values);
var endpoints = _routeValuesBasedEndpointFinder.FindEndpoints(
new RouteValuesBasedEndpointFinderContext()
new RouteValuesAddress()
{
RouteName = routeContext.RouteName,
ExplicitValues = valuesDictionary,

View File

@ -5,7 +5,6 @@ using System;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.EndpointFinders;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@ -52,7 +51,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
{
var services = httpContext.RequestServices;
var linkGenerator = services.GetRequiredService<LinkGenerator>();
var routeValuesBasedEndpointFinder = services.GetRequiredService<IEndpointFinder<RouteValuesBasedEndpointFinderContext>>();
var routeValuesBasedEndpointFinder = services.GetRequiredService<IEndpointFinder<RouteValuesAddress>>();
var logger = services.GetRequiredService<ILogger<EndpointRoutingUrlHelper>>();
urlHelper = new EndpointRoutingUrlHelper(

View File

@ -14,7 +14,7 @@ using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Matchers;
using Microsoft.AspNetCore.Routing.Matching;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives;
using Moq;

View File

@ -13,7 +13,7 @@ using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Matchers;
using Microsoft.AspNetCore.Routing.Matching;
using Microsoft.AspNetCore.Routing.Patterns;
using Moq;
using Xunit;

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Matchers;
using Microsoft.AspNetCore.Routing.Matching;
using Microsoft.AspNetCore.Routing.Patterns;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;