diff --git a/src/Http/Routing/src/Builder/EndpointRouteBuilderExtensions.cs b/src/Http/Routing/src/Builder/EndpointRouteBuilderExtensions.cs index 058304686084..ae05e8132bbe 100644 --- a/src/Http/Routing/src/Builder/EndpointRouteBuilderExtensions.cs +++ b/src/Http/Routing/src/Builder/EndpointRouteBuilderExtensions.cs @@ -29,27 +29,27 @@ public static class EndpointRouteBuilderExtensions private static readonly string[] PatchVerb = new[] { HttpMethods.Patch }; /// - /// Creates a for defining endpoints all prefixed with the specified . + /// Creates a for defining endpoints all prefixed with the specified . /// /// The to add the group to. /// The pattern that prefixes all routes in this group. /// - /// A that is both an and an . + /// A that is both an and an . /// The same builder can be used to add endpoints with the given , and to customize those endpoints using conventions. /// - public static GroupRouteBuilder MapGroup(this IEndpointRouteBuilder endpoints, string prefix) => + public static RouteGroupBuilder MapGroup(this IEndpointRouteBuilder endpoints, string prefix) => endpoints.MapGroup(RoutePatternFactory.Parse(prefix ?? throw new ArgumentNullException(nameof(prefix)))); /// - /// Creates a for defining endpoints all prefixed with the specified . + /// Creates a for defining endpoints all prefixed with the specified . /// /// The to add the group to. /// The pattern that prefixes all routes in this group. /// - /// A that is both an and an . + /// A that is both an and an . /// The same builder can be used to add endpoints with the given , and to customize those endpoints using conventions. /// - public static GroupRouteBuilder MapGroup(this IEndpointRouteBuilder endpoints, RoutePattern prefix) + public static RouteGroupBuilder MapGroup(this IEndpointRouteBuilder endpoints, RoutePattern prefix) { ArgumentNullException.ThrowIfNull(endpoints, nameof(endpoints)); ArgumentNullException.ThrowIfNull(prefix, nameof(prefix)); @@ -525,7 +525,7 @@ private static RouteHandlerBuilder Map( var fullPattern = pattern; - if (endpoints is GroupRouteBuilder group) + if (endpoints is RouteGroupBuilder group) { fullPattern = RoutePatternFactory.Combine(group.GroupPrefix, pattern); } diff --git a/src/Http/Routing/src/PublicAPI.Unshipped.txt b/src/Http/Routing/src/PublicAPI.Unshipped.txt index 632d25fbd8af..8b6001429465 100644 --- a/src/Http/Routing/src/PublicAPI.Unshipped.txt +++ b/src/Http/Routing/src/PublicAPI.Unshipped.txt @@ -1,11 +1,11 @@ #nullable enable Microsoft.AspNetCore.Http.RouteHandlerFilterExtensions -Microsoft.AspNetCore.Routing.GroupRouteBuilder -Microsoft.AspNetCore.Routing.GroupRouteBuilder.GroupPrefix.get -> Microsoft.AspNetCore.Routing.Patterns.RoutePattern! +Microsoft.AspNetCore.Routing.RouteGroupBuilder +Microsoft.AspNetCore.Routing.RouteGroupBuilder.GroupPrefix.get -> Microsoft.AspNetCore.Routing.Patterns.RoutePattern! Microsoft.AspNetCore.Routing.RouteOptions.SetParameterPolicy(string! token, System.Type! type) -> void Microsoft.AspNetCore.Routing.RouteOptions.SetParameterPolicy(string! token) -> void -static Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapGroup(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder! endpoints, Microsoft.AspNetCore.Routing.Patterns.RoutePattern! prefix) -> Microsoft.AspNetCore.Routing.GroupRouteBuilder! -static Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapGroup(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder! endpoints, string! prefix) -> Microsoft.AspNetCore.Routing.GroupRouteBuilder! +static Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapGroup(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder! endpoints, Microsoft.AspNetCore.Routing.Patterns.RoutePattern! prefix) -> Microsoft.AspNetCore.Routing.RouteGroupBuilder! +static Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapGroup(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder! endpoints, string! prefix) -> Microsoft.AspNetCore.Routing.RouteGroupBuilder! static Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapPatch(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder! endpoints, string! pattern, System.Delegate! handler) -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder! static Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapPatch(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder! endpoints, string! pattern, Microsoft.AspNetCore.Http.RequestDelegate! requestDelegate) -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder! override Microsoft.AspNetCore.Routing.RouteValuesAddress.ToString() -> string? diff --git a/src/Http/Routing/src/GroupRouteBuilder.cs b/src/Http/Routing/src/RouteGroupBuilder.cs similarity index 95% rename from src/Http/Routing/src/GroupRouteBuilder.cs rename to src/Http/Routing/src/RouteGroupBuilder.cs index 054cdc8a0018..8ac12cafd18f 100644 --- a/src/Http/Routing/src/GroupRouteBuilder.cs +++ b/src/Http/Routing/src/RouteGroupBuilder.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Routing; /// and interfaces. This can be used to add endpoints with the given , /// and to customize those endpoints using conventions. /// -public sealed class GroupRouteBuilder : IEndpointRouteBuilder, IEndpointConventionBuilder +public sealed class RouteGroupBuilder : IEndpointRouteBuilder, IEndpointConventionBuilder { private readonly IEndpointRouteBuilder _outerEndpointRouteBuilder; private readonly RoutePattern _pattern; @@ -21,12 +21,12 @@ public sealed class GroupRouteBuilder : IEndpointRouteBuilder, IEndpointConventi private readonly List _dataSources = new(); private readonly List> _conventions = new(); - internal GroupRouteBuilder(IEndpointRouteBuilder outerEndpointRouteBuilder, RoutePattern pattern) + internal RouteGroupBuilder(IEndpointRouteBuilder outerEndpointRouteBuilder, RoutePattern pattern) { _outerEndpointRouteBuilder = outerEndpointRouteBuilder; _pattern = pattern; - if (outerEndpointRouteBuilder is GroupRouteBuilder outerGroup) + if (outerEndpointRouteBuilder is RouteGroupBuilder outerGroup) { GroupPrefix = RoutePatternFactory.Combine(outerGroup.GroupPrefix, pattern); } @@ -39,7 +39,7 @@ internal GroupRouteBuilder(IEndpointRouteBuilder outerEndpointRouteBuilder, Rout } /// - /// The prefixing all endpoints defined using this . + /// The prefixing all endpoints defined using this . /// This accounts for nested groups and gives the full group prefix, not just the prefix supplied to the last call to /// . /// @@ -54,9 +54,9 @@ internal GroupRouteBuilder(IEndpointRouteBuilder outerEndpointRouteBuilder, Rout private sealed class GroupDataSource : EndpointDataSource { - private readonly GroupRouteBuilder _groupRouteBuilder; + private readonly RouteGroupBuilder _groupRouteBuilder; - public GroupDataSource(GroupRouteBuilder groupRouteBuilder) + public GroupDataSource(RouteGroupBuilder groupRouteBuilder) { _groupRouteBuilder = groupRouteBuilder; }