add route groups to whats new (#27372)

pull/27376/head
Tom Dykstra 2022-10-25 09:54:13 -07:00 committed by GitHub
parent 153e32a1d5
commit 6799769b48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -184,6 +184,18 @@ The problem details service implements the <xref:Microsoft.AspNetCore.Http.IProb
For more information, see [Problem details service](xref:web-api/handle-errors##pds7)
### Route groups
The <xref:Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapGroup%2A> extension method helps organize groups of endpoints with a common prefix. It reduces repetitive code and allows for customizing entire groups of endpoints with a single call to methods like <xref:Microsoft.AspNetCore.Builder.AuthorizationEndpointConventionBuilderExtensions.RequireAuthorization%2A> and <xref:Microsoft.AspNetCore.Builder.RoutingEndpointConventionBuilderExtensions.WithMetadata%2A>.
For example, the following code creates two similar groups of endpoints:
:::code language="csharp" source="~/fundamentals/minimal-apis/7.0-samples/todo-group2/Program.cs" id="mapgroup":::
:::code language="csharp" source="~/fundamentals/minimal-apis/7.0-samples/todo-group2/TodoEndpoints.cs" id="todoendpoints":::
For more information, see [Route groups](xref:fundamentals/minimal-apis#route-groups)
## gRPC
### JSON transcoding