Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Designs ASP.NET Core Minimal APIs with handler-first endpoints, route groups, filters, and guidance on choosing them over controllers.
95% 100%+5 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
3 of 3 safety checks passed
Build nested groups for complex API structures:
var api = app.MapGroup("/api/v1")
.RequireAuthorization();
var products = api.MapGroup("/products")
.WithTags("Products");
var productReviews = products.MapGroup("/{productId:int}/reviews")
.WithTags("Product Reviews");
productReviews.MapGet("/", GetReviewsForProduct);
productReviews.MapPost("/", AddReviewToProduct);
productReviews.MapGet("/{reviewId:int}", GetReviewById);
Apply route constraints at the group level:
var products = app.MapGroup("/api/products/{productId:int:min(1)}")
.AddEndpointFilter(async (context, next) =>
{
var productId = context.GetArgument<int>(0);
var db = context.HttpContext.RequestServices.GetRequiredService<AppDb>();
if (!await db.Products.AnyAsync(p => p.Id == productId))
return TypedResults.NotFound();
return await next(context);
});
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.