Skip to content

[Route Groups] Rename GroupRouteBuilder to RouteGroupBuilder #41781

Closed
@halter73

Description

@halter73

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, IEndpointConventionBuilder

Usage 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 GroupRouteBuilder since 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-approvedAPI 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

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions