-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Description
Background and Motivation
RouteGroupBuilder sounds better than GroupRouteBuilder. In the original API proposal (#36007) this was called RouteGroup which is closer to the name I am suggesting here. RouteGroup is also an alternative name that I think is better than GroupRouteBuilder. I proposed GroupRouteBuilder in the follow up comments because it better aligned with IEndpointRouteBuilder, but now I think that's unimportant.
Proposed API
namespace Microsoft.AspNetCore.Routing;
- public sealed class GroupRouteBuilder : IEndpointRouteBuilder, IEndpointConventionBuilder
+ public sealed class RouteGroupBuilder : IEndpointRouteBuilder, IEndpointConventionBuilderUsage Examples
Before
GroupRouteBuilder group = app.MapGroup("/todos");
group.MapGet("/", (int id, TodoDb db) => db.ToListAsync());After
RouteGroupBuilder group = app.MapGroup("/todos");
group.MapGet("/", (int id, TodoDb db) => db.ToListAsync());Alternative Designs
- Keep it as
GroupRouteBuildersince that puts "Group" up front even if using "Group" as an adjective sound weird. - Go with the ven shorter
RouteGroup.
Risks
Low. It's only been released in preview4 and it would only break apps that reference the type name instead of just using var.
abbasghomimottaghipour
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels