Skip to content
Discussion options

You must be logged in to vote

@mrhighstone, thanks for raising this.

On nested resource paths

The template convention maps each IEndpointGroup to a flat /api/{ClassName} prefix by default. As of Release v10.6.0, groups can override that convention by declaring a RoutePrefix property:

public class TodoItems : IEndpointGroup
{
    public static string RoutePrefix => "/api/TodoLists/{todoListId}/TodoItems";

    public static void Map(RouteGroupBuilder groupBuilder)
    {
        groupBuilder.MapPatch(UpdateTodoItemDetail, "UpdateDetail/{id}").RequireAuthorization();
        // ...
    }

    public static async Task<Results<NoContent, BadRequest>> UpdateTodoItemDetail(
        ISender sender, int todoListId, int id, Upd…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mrhighstone
Comment options

Answer selected by jasontaylordev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants