Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

EndpointRouteBuilderExtensions.MapGroup Method

Definition

Namespace:
Microsoft.AspNetCore.Builder
Assembly:
Microsoft.AspNetCore.Routing.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
MapGroup(IEndpointRouteBuilder, RoutePattern)

Creates a RouteGroupBuilder for defining endpoints all prefixed with the specified prefix.

MapGroup(IEndpointRouteBuilder, String)

Creates a RouteGroupBuilder for defining endpoints all prefixed with the specified prefix.

MapGroup(IEndpointRouteBuilder, RoutePattern)

Source:
EndpointRouteBuilderExtensions.cs

Creates a RouteGroupBuilder for defining endpoints all prefixed with the specified prefix.

public static Microsoft.AspNetCore.Routing.RouteGroupBuilder MapGroup(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, Microsoft.AspNetCore.Routing.Patterns.RoutePattern prefix);
static member MapGroup : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * Microsoft.AspNetCore.Routing.Patterns.RoutePattern -> Microsoft.AspNetCore.Routing.RouteGroupBuilder
<Extension()>
Public Function MapGroup (endpoints As IEndpointRouteBuilder, prefix As RoutePattern) As RouteGroupBuilder

Parameters

endpoints
IEndpointRouteBuilder

The IEndpointRouteBuilder to add the group to.

prefix
RoutePattern

The pattern that prefixes all routes in this group.

Returns

A RouteGroupBuilder that is both an IEndpointRouteBuilder and an IEndpointConventionBuilder. The same builder can be used to add endpoints with the given prefix, and to customize those endpoints using conventions.

Applies to

MapGroup(IEndpointRouteBuilder, String)

Source:
EndpointRouteBuilderExtensions.cs

Creates a RouteGroupBuilder for defining endpoints all prefixed with the specified prefix.

public static Microsoft.AspNetCore.Routing.RouteGroupBuilder MapGroup(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string prefix);
static member MapGroup : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string -> Microsoft.AspNetCore.Routing.RouteGroupBuilder
<Extension()>
Public Function MapGroup (endpoints As IEndpointRouteBuilder, prefix As String) As RouteGroupBuilder

Parameters

endpoints
IEndpointRouteBuilder

The IEndpointRouteBuilder to add the group to.

prefix
String

The pattern that prefixes all routes in this group.

Returns

A RouteGroupBuilder that is both an IEndpointRouteBuilder and an IEndpointConventionBuilder. The same builder can be used to add endpoints with the given prefix, and to customize those endpoints using conventions.

Applies to


Feedback

Was this page helpful?