Replace remaining references to global routing (#8312)
This commit is contained in:
parent
cbe1526763
commit
03da30f3bf
|
|
@ -118,7 +118,7 @@ namespace Microsoft.AspNetCore.Builder
|
|||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException($"Cannot use '{router.GetType().FullName}' with Global Routing.");
|
||||
throw new InvalidOperationException($"Cannot use '{router.GetType().FullName}' with Endpoint Routing.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
services.TryAddTransient<MvcAttributeRouteHandler>(); // Many per app
|
||||
|
||||
//
|
||||
// Global Routing / Endpoints
|
||||
// Endpoint Routing / Endpoints
|
||||
//
|
||||
services.TryAddEnumerable(
|
||||
ServiceDescriptor.Singleton<EndpointDataSource, MvcEndpointDataSource>());
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
// up the endpoints too.
|
||||
//
|
||||
// Start with an order of '1' for conventional routes as attribute routes have a default order of '0'.
|
||||
// This is for scenarios dealing with migrating existing Router based code to Global Routing world.
|
||||
// This is for scenarios dealing with migrating existing Router based code to Endpoint Routing world.
|
||||
var conventionalRouteOrder = 0;
|
||||
|
||||
// Check each of the conventional templates to see if the action would be reachable
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
foundMatchingConstraint = true;
|
||||
|
||||
// Before we run the constraint, we need to initialize the route values.
|
||||
// In global routing, the route values are per-endpoint.
|
||||
// In endpoint routing, the route values are per-endpoint.
|
||||
constraintContext.RouteContext = new RouteContext(httpContext)
|
||||
{
|
||||
RouteData = new RouteData(candidateSet[item.index].Values),
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
{
|
||||
}
|
||||
|
||||
[Fact] // This intentionally returns a 405 with global routing
|
||||
[Fact] // This intentionally returns a 405 with endpoint routing
|
||||
public override async Task PreflightRequestOnNonCorsEnabledController_DoesNotMatchTheAction()
|
||||
{
|
||||
// Arrange
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
result.Routers);
|
||||
}
|
||||
|
||||
// Global routing exposes HTTP 405s for HTTP method mismatches
|
||||
// Endpoint routing exposes HTTP 405s for HTTP method mismatches
|
||||
[Fact]
|
||||
public override async Task ConventionalRoutedController_InArea_ActionBlockedByHttpMethod()
|
||||
{
|
||||
|
|
@ -97,7 +97,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
Assert.Equal(HttpStatusCode.MethodNotAllowed, response.StatusCode);
|
||||
}
|
||||
|
||||
// Global routing exposes HTTP 405s for HTTP method mismatches
|
||||
// Endpoint routing exposes HTTP 405s for HTTP method mismatches
|
||||
[Fact]
|
||||
public override async Task AttributeRoutedAction_MultipleRouteAttributes_RouteAttributeTemplatesIgnoredForOverrideActions()
|
||||
{
|
||||
|
|
@ -111,7 +111,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
Assert.Equal(HttpStatusCode.MethodNotAllowed, response.StatusCode);
|
||||
}
|
||||
|
||||
// Global routing exposes HTTP 405s for HTTP method mismatches
|
||||
// Endpoint routing exposes HTTP 405s for HTTP method mismatches
|
||||
[Theory]
|
||||
[MemberData(nameof(AttributeRoutedAction_MultipleRouteAttributes_WithMultipleHttpAttributes_RespectsConstraintsData))]
|
||||
public override async Task AttributeRoutedAction_MultipleRouteAttributes_WithMultipleHttpAttributes_RespectsConstraints(
|
||||
|
|
@ -128,7 +128,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
Assert.Equal(HttpStatusCode.MethodNotAllowed, response.StatusCode);
|
||||
}
|
||||
|
||||
// Global routing exposes HTTP 405s for HTTP method mismatches
|
||||
// Endpoint routing exposes HTTP 405s for HTTP method mismatches
|
||||
[Theory]
|
||||
[MemberData(nameof(AttributeRoutedAction_RejectsRequestsWithWrongMethods_InRoutesWithoutExtraTemplateSegmentsOnTheActionData))]
|
||||
public override async Task AttributeRoutedAction_RejectsRequestsWithWrongMethods_InRoutesWithoutExtraTemplateSegmentsOnTheAction(
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace BasicWebSite
|
|||
services.AddRouting();
|
||||
|
||||
services.AddMvc()
|
||||
.SetCompatibilityVersion(CompatibilityVersion.Latest) // this compat version enables global routing
|
||||
.SetCompatibilityVersion(CompatibilityVersion.Latest) // this compat version enables endpoint routing
|
||||
.AddXmlDataContractSerializerFormatters();
|
||||
|
||||
services.ConfigureBaseWebSiteAuthPolicies();
|
||||
|
|
|
|||
Loading…
Reference in New Issue