Aller au contenu

Unused route parameter (ASP0018)

Ce contenu n’est pas encore disponible dans votre langue.

Key dotnet.api.unused-route-parameter · Severity info · Category api

ASP.NET Core analyzer ASP0018. Flags a route parameter the handler or action never binds - either a typo in one of the two names or a segment that should not be a parameter.

app.MapGet("/customers/{customerId}/orders", () => List());
app.MapGet("/customers/{customerId}/orders", (int customerId) => List(customerId));