Merge branch 'merge/release/2.2-to-master'

This commit is contained in:
James Newton-King 2018-08-23 10:55:40 +12:00
commit e2695674df
No known key found for this signature in database
GPG Key ID: 0A66B2F456BF5526
7 changed files with 10 additions and 10 deletions

View File

@ -118,7 +118,7 @@ namespace Microsoft.AspNetCore.Builder
} }
else else
{ {
throw new InvalidOperationException($"Cannot use '{router.GetType().FullName}' with Global Routing."); throw new InvalidOperationException($"Cannot use '{router.GetType().FullName}' with Endpoint Routing.");
} }
} }

View File

@ -265,7 +265,7 @@ namespace Microsoft.Extensions.DependencyInjection
services.TryAddTransient<MvcAttributeRouteHandler>(); // Many per app services.TryAddTransient<MvcAttributeRouteHandler>(); // Many per app
// //
// Global Routing / Endpoints // Endpoint Routing / Endpoints
// //
services.TryAddEnumerable( services.TryAddEnumerable(
ServiceDescriptor.Singleton<EndpointDataSource, MvcEndpointDataSource>()); ServiceDescriptor.Singleton<EndpointDataSource, MvcEndpointDataSource>());

View File

@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
// up the endpoints too. // up the endpoints too.
// //
// Start with an order of '1' for conventional routes as attribute routes have a default order of '0'. // 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; var conventionalRouteOrder = 0;
// Check each of the conventional templates to see if the action would be reachable // Check each of the conventional templates to see if the action would be reachable

View File

@ -189,7 +189,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
foundMatchingConstraint = true; foundMatchingConstraint = true;
// Before we run the constraint, we need to initialize the route values. // 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) constraintContext.RouteContext = new RouteContext(httpContext)
{ {
RouteData = new RouteData(candidateSet[item.index].Values), RouteData = new RouteData(candidateSet[item.index].Values),

View File

@ -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() public override async Task PreflightRequestOnNonCorsEnabledController_DoesNotMatchTheAction()
{ {
// Arrange // Arrange

View File

@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
result.Routers); result.Routers);
} }
// Global routing exposes HTTP 405s for HTTP method mismatches // Endpoint routing exposes HTTP 405s for HTTP method mismatches
[Fact] [Fact]
public override async Task ConventionalRoutedController_InArea_ActionBlockedByHttpMethod() public override async Task ConventionalRoutedController_InArea_ActionBlockedByHttpMethod()
{ {
@ -97,7 +97,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
Assert.Equal(HttpStatusCode.MethodNotAllowed, response.StatusCode); 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] [Fact]
public override async Task AttributeRoutedAction_MultipleRouteAttributes_RouteAttributeTemplatesIgnoredForOverrideActions() public override async Task AttributeRoutedAction_MultipleRouteAttributes_RouteAttributeTemplatesIgnoredForOverrideActions()
{ {
@ -111,7 +111,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
Assert.Equal(HttpStatusCode.MethodNotAllowed, response.StatusCode); 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] [Theory]
[MemberData(nameof(AttributeRoutedAction_MultipleRouteAttributes_WithMultipleHttpAttributes_RespectsConstraintsData))] [MemberData(nameof(AttributeRoutedAction_MultipleRouteAttributes_WithMultipleHttpAttributes_RespectsConstraintsData))]
public override async Task AttributeRoutedAction_MultipleRouteAttributes_WithMultipleHttpAttributes_RespectsConstraints( public override async Task AttributeRoutedAction_MultipleRouteAttributes_WithMultipleHttpAttributes_RespectsConstraints(
@ -128,7 +128,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
Assert.Equal(HttpStatusCode.MethodNotAllowed, response.StatusCode); 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] [Theory]
[MemberData(nameof(AttributeRoutedAction_RejectsRequestsWithWrongMethods_InRoutesWithoutExtraTemplateSegmentsOnTheActionData))] [MemberData(nameof(AttributeRoutedAction_RejectsRequestsWithWrongMethods_InRoutesWithoutExtraTemplateSegmentsOnTheActionData))]
public override async Task AttributeRoutedAction_RejectsRequestsWithWrongMethods_InRoutesWithoutExtraTemplateSegmentsOnTheAction( public override async Task AttributeRoutedAction_RejectsRequestsWithWrongMethods_InRoutesWithoutExtraTemplateSegmentsOnTheAction(

View File

@ -15,7 +15,7 @@ namespace BasicWebSite
services.AddRouting(); services.AddRouting();
services.AddMvc() services.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Latest) // this compat version enables global routing .SetCompatibilityVersion(CompatibilityVersion.Latest) // this compat version enables endpoint routing
.AddXmlDataContractSerializerFormatters(); .AddXmlDataContractSerializerFormatters();
services.ConfigureBaseWebSiteAuthPolicies(); services.ConfigureBaseWebSiteAuthPolicies();