From cbe152676305cd9a70be5998fcf301ab13d3ccf4 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Wed, 22 Aug 2018 17:15:09 +1200 Subject: [PATCH] React to routing changes (#8303) --- build/dependencies.props | 4 +- .../Internal/MvcEndpointDataSource.cs | 14 ++-- .../Routing/ConsumesMatcherPolicy.cs | 4 +- .../Routing/UrlHelperFactory.cs | 1 + .../Internal/MvcEndpointDataSourceTests.cs | 69 ++++++++++--------- .../ActionConstraintMatcherPolicyTest.cs | 7 +- .../Routing/ConsumesMatcherPolicyTest.cs | 7 +- .../Routing/EndpointRoutingUrlHelperTest.cs | 41 +++++------ .../Controllers/RoutingController.cs | 2 +- .../Controllers/RoutingController.cs | 2 +- .../Controllers/RoutingController.cs | 2 +- 11 files changed, 79 insertions(+), 74 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index e1fbf0322d..5e0c447c05 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -48,8 +48,8 @@ 2.2.0-preview1-34967 2.2.0-preview1-34967 2.2.0-preview1-34967 - 2.2.0-preview1-34967 - 2.2.0-preview1-34967 + 2.2.0-a-preview2-matcherendpoint-rename-16892 + 2.2.0-a-preview2-matcherendpoint-rename-16892 2.2.0-preview1-34967 2.2.0-preview1-34967 2.2.0-preview1-34967 diff --git a/src/Microsoft.AspNetCore.Mvc.Core/Internal/MvcEndpointDataSource.cs b/src/Microsoft.AspNetCore.Mvc.Core/Internal/MvcEndpointDataSource.cs index 9e4ff9b92c..5955b3fe04 100644 --- a/src/Microsoft.AspNetCore.Mvc.Core/Internal/MvcEndpointDataSource.cs +++ b/src/Microsoft.AspNetCore.Mvc.Core/Internal/MvcEndpointDataSource.cs @@ -6,11 +6,11 @@ using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Routing; using Microsoft.AspNetCore.Routing; -using Microsoft.AspNetCore.Routing.Matching; using Microsoft.AspNetCore.Routing.Patterns; using Microsoft.AspNetCore.Routing.Template; using Microsoft.Extensions.Primitives; @@ -262,7 +262,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal return false; } - private MatcherEndpoint CreateEndpoint( + private RouteEndpoint CreateEndpoint( ActionDescriptor action, string routeName, string template, @@ -271,9 +271,9 @@ namespace Microsoft.AspNetCore.Mvc.Internal object source, bool suppressLinkGeneration) { - RequestDelegate invokerDelegate = (context) => + RequestDelegate requestDelegate = (context) => { - var values = context.Features.Get().Values; + var values = context.Features.Get().RouteValues; var routeData = new RouteData(); foreach (var kvp in values) { @@ -299,9 +299,9 @@ namespace Microsoft.AspNetCore.Mvc.Internal source, suppressLinkGeneration); - var endpoint = new MatcherEndpoint( - next => invokerDelegate, - RoutePatternFactory.Parse(template, defaults, constraints: null), + var endpoint = new RouteEndpoint( + requestDelegate, + RoutePatternFactory.Parse(template, defaults, parameterPolicies: null), order, metadataCollection, action.DisplayName); diff --git a/src/Microsoft.AspNetCore.Mvc.Core/Routing/ConsumesMatcherPolicy.cs b/src/Microsoft.AspNetCore.Mvc.Core/Routing/ConsumesMatcherPolicy.cs index 3adacf3c38..507d3bcf68 100644 --- a/src/Microsoft.AspNetCore.Mvc.Core/Routing/ConsumesMatcherPolicy.cs +++ b/src/Microsoft.AspNetCore.Mvc.Core/Routing/ConsumesMatcherPolicy.cs @@ -135,8 +135,8 @@ namespace Microsoft.AspNetCore.Mvc.Routing private Endpoint CreateRejectionEndpoint() { - return new MatcherEndpoint( - (next) => (context) => + return new RouteEndpoint( + (context) => { context.Response.StatusCode = StatusCodes.Status415UnsupportedMediaType; return Task.CompletedTask; diff --git a/src/Microsoft.AspNetCore.Mvc.Core/Routing/UrlHelperFactory.cs b/src/Microsoft.AspNetCore.Mvc.Core/Routing/UrlHelperFactory.cs index 933f339f30..dfe16c2421 100644 --- a/src/Microsoft.AspNetCore.Mvc.Core/Routing/UrlHelperFactory.cs +++ b/src/Microsoft.AspNetCore.Mvc.Core/Routing/UrlHelperFactory.cs @@ -3,6 +3,7 @@ using System; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; diff --git a/test/Microsoft.AspNetCore.Mvc.Core.Test/Internal/MvcEndpointDataSourceTests.cs b/test/Microsoft.AspNetCore.Mvc.Core.Test/Internal/MvcEndpointDataSourceTests.cs index bc8d0dbcdc..ca09424a52 100644 --- a/test/Microsoft.AspNetCore.Mvc.Core.Test/Internal/MvcEndpointDataSourceTests.cs +++ b/test/Microsoft.AspNetCore.Mvc.Core.Test/Internal/MvcEndpointDataSourceTests.cs @@ -64,7 +64,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert var endpoint = Assert.Single(endpoints); - var matcherEndpoint = Assert.IsType(endpoint); + var matcherEndpoint = Assert.IsType(endpoint); var routeValuesAddressMetadata = matcherEndpoint.Metadata.GetMetadata(); Assert.NotNull(routeValuesAddressMetadata); @@ -77,14 +77,17 @@ namespace Microsoft.AspNetCore.Mvc.Internal } [Fact] - public void Endpoints_InvokeReturnedEndpoint_ActionInvokerProviderCalled() + public async Task Endpoints_InvokeReturnedEndpoint_ActionInvokerProviderCalled() { // Arrange - var featureCollection = new FeatureCollection(); - featureCollection.Set(new EndpointFeature + var endpointFeature = new EndpointFeature { - Values = new RouteValueDictionary() - }); + RouteValues = new RouteValueDictionary() + }; + + var featureCollection = new FeatureCollection(); + featureCollection.Set(endpointFeature); + featureCollection.Set(endpointFeature); var httpContextMock = new Mock(); httpContextMock.Setup(m => m.Features).Returns(featureCollection); @@ -122,11 +125,9 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert var endpoint = Assert.Single(endpoints); - var matcherEndpoint = Assert.IsType(endpoint); + var matcherEndpoint = Assert.IsType(endpoint); - var invokerDelegate = matcherEndpoint.Invoker((next) => Task.CompletedTask); - - invokerDelegate(httpContextMock.Object); + await matcherEndpoint.RequestDelegate(httpContextMock.Object); Assert.True(actionInvokerCalled); } @@ -138,7 +139,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal var featureCollection = new FeatureCollection(); featureCollection.Set(new EndpointFeature { - Values = new RouteValueDictionary() + RouteValues = new RouteValueDictionary() }); var httpContextMock = new Mock(); @@ -199,7 +200,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert var inspectors = finalEndpointTemplates - .Select(t => new Action(e => Assert.Equal(t, Assert.IsType(e).RoutePattern.RawText))) + .Select(t => new Action(e => Assert.Equal(t, Assert.IsType(e).RoutePattern.RawText))) .ToArray(); // Assert @@ -226,7 +227,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert var inspectors = finalEndpointTemplates - .Select(t => new Action(e => Assert.Equal(t, Assert.IsType(e).RoutePattern.RawText))) + .Select(t => new Action(e => Assert.Equal(t, Assert.IsType(e).RoutePattern.RawText))) .ToArray(); // Assert @@ -250,8 +251,8 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert Assert.Collection(endpoints, - (e) => Assert.Equal("TestController", Assert.IsType(e).RoutePattern.RawText), - (e) => Assert.Equal("TestController/TestAction", Assert.IsType(e).RoutePattern.RawText)); + (e) => Assert.Equal("TestController", Assert.IsType(e).RoutePattern.RawText), + (e) => Assert.Equal("TestController/TestAction", Assert.IsType(e).RoutePattern.RawText)); } [Fact] @@ -278,8 +279,8 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert Assert.Collection(endpoints1, - (e) => Assert.Equal("TestController", Assert.IsType(e).RoutePattern.RawText), - (e) => Assert.Equal("TestController/TestAction", Assert.IsType(e).RoutePattern.RawText)); + (e) => Assert.Equal("TestController", Assert.IsType(e).RoutePattern.RawText), + (e) => Assert.Equal("TestController/TestAction", Assert.IsType(e).RoutePattern.RawText)); Assert.Same(endpoints1, endpoints2); actionDescriptorCollectionProviderMock.VerifyGet(m => m.ActionDescriptors, Times.Once); @@ -320,8 +321,8 @@ namespace Microsoft.AspNetCore.Mvc.Internal var endpoints = dataSource.Endpoints; Assert.Collection(endpoints, - (e) => Assert.Equal("TestController", Assert.IsType(e).RoutePattern.RawText), - (e) => Assert.Equal("TestController/TestAction", Assert.IsType(e).RoutePattern.RawText)); + (e) => Assert.Equal("TestController", Assert.IsType(e).RoutePattern.RawText), + (e) => Assert.Equal("TestController/TestAction", Assert.IsType(e).RoutePattern.RawText)); actionDescriptorCollectionProviderMock .Setup(m => m.ActionDescriptors) @@ -337,7 +338,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal Assert.NotSame(endpoints, newEndpoints); Assert.Collection(newEndpoints, - (e) => Assert.Equal("NewTestController/NewTestAction", Assert.IsType(e).RoutePattern.RawText)); + (e) => Assert.Equal("NewTestController/NewTestAction", Assert.IsType(e).RoutePattern.RawText)); } [Fact] @@ -359,8 +360,8 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert Assert.Collection(endpoints, - (e) => Assert.Equal("TestController/TestAction1", Assert.IsType(e).RoutePattern.RawText), - (e) => Assert.Equal("TestController/TestAction2", Assert.IsType(e).RoutePattern.RawText)); + (e) => Assert.Equal("TestController/TestAction1", Assert.IsType(e).RoutePattern.RawText), + (e) => Assert.Equal("TestController/TestAction2", Assert.IsType(e).RoutePattern.RawText)); } [Theory] @@ -383,7 +384,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal var endpoints = dataSource.Endpoints; var inspectors = finalEndpointTemplates - .Select(t => new Action(e => Assert.Equal(t, Assert.IsType(e).RoutePattern.RawText))) + .Select(t => new Action(e => Assert.Equal(t, Assert.IsType(e).RoutePattern.RawText))) .ToArray(); // Assert @@ -405,7 +406,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert var endpoint = Assert.Single(endpoints); - var matcherEndpoint = Assert.IsType(endpoint); + var matcherEndpoint = Assert.IsType(endpoint); var routeValuesAddressNameMetadata = matcherEndpoint.Metadata.GetMetadata(); Assert.NotNull(routeValuesAddressNameMetadata); Assert.Equal(string.Empty, routeValuesAddressNameMetadata.Name); @@ -430,7 +431,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal endpoints, (ep) => { - var matcherEndpoint = Assert.IsType(ep); + var matcherEndpoint = Assert.IsType(ep); var routeValuesAddressMetadata = matcherEndpoint.Metadata.GetMetadata(); Assert.NotNull(routeValuesAddressMetadata); Assert.Equal("namedRoute", routeValuesAddressMetadata.Name); @@ -438,7 +439,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal }, (ep) => { - var matcherEndpoint = Assert.IsType(ep); + var matcherEndpoint = Assert.IsType(ep); var routeValuesAddressMetadata = matcherEndpoint.Metadata.GetMetadata(); Assert.NotNull(routeValuesAddressMetadata); Assert.Equal("namedRoute", routeValuesAddressMetadata.Name); @@ -469,25 +470,25 @@ namespace Microsoft.AspNetCore.Mvc.Internal endpoints, (ep) => { - var matcherEndpoint = Assert.IsType(ep); + var matcherEndpoint = Assert.IsType(ep); Assert.Equal("Home/Index/{id?}", matcherEndpoint.RoutePattern.RawText); Assert.Equal(1, matcherEndpoint.Order); }, (ep) => { - var matcherEndpoint = Assert.IsType(ep); + var matcherEndpoint = Assert.IsType(ep); Assert.Equal("named/Home/Index/{id?}", matcherEndpoint.RoutePattern.RawText); Assert.Equal(2, matcherEndpoint.Order); }, (ep) => { - var matcherEndpoint = Assert.IsType(ep); + var matcherEndpoint = Assert.IsType(ep); Assert.Equal("Products/Details/{id?}", matcherEndpoint.RoutePattern.RawText); Assert.Equal(1, matcherEndpoint.Order); }, (ep) => { - var matcherEndpoint = Assert.IsType(ep); + var matcherEndpoint = Assert.IsType(ep); Assert.Equal("named/Products/Details/{id?}", matcherEndpoint.RoutePattern.RawText); Assert.Equal(2, matcherEndpoint.Order); }); @@ -589,7 +590,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert var endpoint = Assert.Single(endpoints); - var matcherEndpoint = Assert.IsType(endpoint); + var matcherEndpoint = Assert.IsType(endpoint); Assert.Equal("Foo/Bar", matcherEndpoint.RoutePattern.RawText); AssertIsSubset(expectedDefaults, matcherEndpoint.RoutePattern.Defaults); } @@ -611,7 +612,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert var endpoint = Assert.Single(endpoints); - var matcherEndpoint = Assert.IsType(endpoint); + var matcherEndpoint = Assert.IsType(endpoint); Assert.Equal("Foo/Bar", matcherEndpoint.RoutePattern.RawText); AssertIsSubset(expectedDefaults, matcherEndpoint.RoutePattern.Defaults); } @@ -634,7 +635,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert var endpoint = Assert.Single(endpoints); - var matcherEndpoint = Assert.IsType(endpoint); + var matcherEndpoint = Assert.IsType(endpoint); Assert.Equal("Foo/Bar/{subscription=general}", matcherEndpoint.RoutePattern.RawText); AssertIsSubset(expectedDefaults, matcherEndpoint.RoutePattern.Defaults); } @@ -656,7 +657,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal // Assert var endpoint = Assert.Single(endpoints); - var matcherEndpoint = Assert.IsType(endpoint); + var matcherEndpoint = Assert.IsType(endpoint); Assert.Equal("Foo/Bar", matcherEndpoint.RoutePattern.RawText); AssertIsSubset(expectedDefaults, matcherEndpoint.RoutePattern.Defaults); } diff --git a/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/ActionConstraintMatcherPolicyTest.cs b/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/ActionConstraintMatcherPolicyTest.cs index 31e3dd8653..a423dfd2e3 100644 --- a/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/ActionConstraintMatcherPolicyTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/ActionConstraintMatcherPolicyTest.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.ActionConstraints; @@ -369,11 +370,11 @@ namespace Microsoft.AspNetCore.Mvc.Routing return httpContext; } - private static MatcherEndpoint CreateEndpoint(ActionDescriptor action) + private static RouteEndpoint CreateEndpoint(ActionDescriptor action) { var metadata = new List() { action, }; - return new MatcherEndpoint( - (r) => null, + return new RouteEndpoint( + (context) => Task.CompletedTask, RoutePatternFactory.Parse("/"), 0, new EndpointMetadataCollection(metadata), diff --git a/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/ConsumesMatcherPolicyTest.cs b/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/ConsumesMatcherPolicyTest.cs index 48a49e465e..cad3edc0b9 100644 --- a/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/ConsumesMatcherPolicyTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/ConsumesMatcherPolicyTest.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing.Matching; @@ -212,7 +213,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing Assert.Equal(expected, actual); } - private static MatcherEndpoint CreateEndpoint(string template, ConsumesMetadata consumesMetadata) + private static RouteEndpoint CreateEndpoint(string template, ConsumesMetadata consumesMetadata) { var metadata = new List(); if (consumesMetadata != null) @@ -220,8 +221,8 @@ namespace Microsoft.AspNetCore.Mvc.Routing metadata.Add(consumesMetadata); } - return new MatcherEndpoint( - (next) => null, + return new RouteEndpoint( + (context) => Task.CompletedTask, RoutePatternFactory.Parse(template), 0, new EndpointMetadataCollection(metadata), diff --git a/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/EndpointRoutingUrlHelperTest.cs b/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/EndpointRoutingUrlHelperTest.cs index e02dd3c5c9..6853dd7180 100644 --- a/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/EndpointRoutingUrlHelperTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/EndpointRoutingUrlHelperTest.cs @@ -5,6 +5,8 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing.Matching; using Microsoft.AspNetCore.Routing.Patterns; @@ -60,8 +62,9 @@ namespace Microsoft.AspNetCore.Mvc.Routing // Set the endpoint feature and current context just as a normal request to MVC app would be var endpointFeature = new EndpointFeature(); urlHelper.ActionContext.HttpContext.Features.Set(endpointFeature); + urlHelper.ActionContext.HttpContext.Features.Set(endpointFeature); endpointFeature.Endpoint = endpoint1; - endpointFeature.Values = new RouteValueDictionary + endpointFeature.RouteValues = new RouteValueDictionary { ["controller"] = "Orders", ["action"] = "GetById", @@ -123,7 +126,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing protected override IUrlHelper CreateUrlHelper(string appRoot, string host, string protocol) { - return CreateUrlHelper(Enumerable.Empty(), appRoot, host, protocol); + return CreateUrlHelper(Enumerable.Empty(), appRoot, host, protocol); } protected override IUrlHelper CreateUrlHelperWithDefaultRoutes(string appRoot, string host, string protocol) @@ -139,8 +142,8 @@ namespace Microsoft.AspNetCore.Mvc.Routing string template) { var endpoints = GetDefaultEndpoints(); - endpoints.Add(new MatcherEndpoint( - next => httpContext => Task.CompletedTask, + endpoints.Add(new RouteEndpoint( + httpContext => Task.CompletedTask, RoutePatternFactory.Parse(template), 0, EndpointMetadataCollection.Empty, @@ -153,10 +156,8 @@ namespace Microsoft.AspNetCore.Mvc.Routing var httpContext = actionContext.HttpContext; httpContext.Features.Set(new EndpointFeature() { - Endpoint = new MatcherEndpoint( - next => cntxt => Task.CompletedTask, - RoutePatternFactory.Parse("/"), - 0, + Endpoint = new Endpoint( + context => Task.CompletedTask, EndpointMetadataCollection.Empty, null) }); @@ -187,7 +188,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing return CreateUrlHelper(actionContext); } - private IUrlHelper CreateUrlHelper(IEnumerable endpoints, ActionContext actionContext = null) + private IUrlHelper CreateUrlHelper(IEnumerable endpoints, ActionContext actionContext = null) { var serviceProvider = CreateServices(endpoints); var httpContext = CreateHttpContext(serviceProvider, null, null, "http"); @@ -196,7 +197,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing } private IUrlHelper CreateUrlHelper( - IEnumerable endpoints, + IEnumerable endpoints, string appRoot, string host, string protocol) @@ -207,9 +208,9 @@ namespace Microsoft.AspNetCore.Mvc.Routing return CreateUrlHelper(actionContext); } - private List GetDefaultEndpoints() + private List GetDefaultEndpoints() { - var endpoints = new List(); + var endpoints = new List(); endpoints.Add( CreateEndpoint( "home/newaction/{id}", @@ -278,7 +279,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing return endpoints; } - private MatcherEndpoint CreateEndpoint( + private RouteEndpoint CreateEndpoint( string template, object defaults = null, object requiredValues = null, @@ -292,9 +293,9 @@ namespace Microsoft.AspNetCore.Mvc.Routing new RouteValuesAddressMetadata(routeName, new RouteValueDictionary(requiredValues))); } - return new MatcherEndpoint( - next => (httpContext) => Task.CompletedTask, - RoutePatternFactory.Parse(template, defaults, constraints: null), + return new RouteEndpoint( + (httpContext) => Task.CompletedTask, + RoutePatternFactory.Parse(template, defaults, parameterPolicies: null), order, metadataCollection, null); @@ -315,11 +316,11 @@ namespace Microsoft.AspNetCore.Mvc.Routing return services.BuildServiceProvider(); } - private MatcherEndpoint GetEndpoint(string name, string template, RouteValueDictionary defaults) + private RouteEndpoint GetEndpoint(string name, string template, RouteValueDictionary defaults) { - return new MatcherEndpoint( - next => c => Task.CompletedTask, - RoutePatternFactory.Parse(template, defaults, constraints: null), + return new RouteEndpoint( + c => Task.CompletedTask, + RoutePatternFactory.Parse(template, defaults, parameterPolicies: null), 0, EndpointMetadataCollection.Empty, null); diff --git a/test/WebSites/BasicWebSite/Controllers/RoutingController.cs b/test/WebSites/BasicWebSite/Controllers/RoutingController.cs index afe914f572..e2c416505d 100644 --- a/test/WebSites/BasicWebSite/Controllers/RoutingController.cs +++ b/test/WebSites/BasicWebSite/Controllers/RoutingController.cs @@ -1,8 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Routing; namespace BasicWebSite { diff --git a/test/WebSites/RoutingWebSite/Controllers/RoutingController.cs b/test/WebSites/RoutingWebSite/Controllers/RoutingController.cs index 354ff5539a..ba7df5622b 100644 --- a/test/WebSites/RoutingWebSite/Controllers/RoutingController.cs +++ b/test/WebSites/RoutingWebSite/Controllers/RoutingController.cs @@ -1,8 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Routing; namespace RoutingWebSite { diff --git a/test/WebSites/VersioningWebSite/Controllers/RoutingController.cs b/test/WebSites/VersioningWebSite/Controllers/RoutingController.cs index aad2099d1d..709fb51494 100644 --- a/test/WebSites/VersioningWebSite/Controllers/RoutingController.cs +++ b/test/WebSites/VersioningWebSite/Controllers/RoutingController.cs @@ -1,8 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Routing; namespace VersioningWebSite {