Aller au contenu

Invalid route pattern (ASP0017)

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

Key dotnet.api.invalid-route-pattern · Severity error · Category api

ASP.NET Core analyzer ASP0017. Flags a route template that does not parse - an unbalanced brace, an invalid constraint, a repeated parameter. It fails when the endpoint is built.

app.MapGet("/orders/{id:int", (int id) => Find(id));
app.MapGet("/orders/{id:int}", (int id) => Find(id));