İçeriğe geç

Route conflict between route handlers (ASP0022)

Anahtar dotnet.api.route-handler-conflict · Önem warning · Kategori api

ASP.NET Core analizörü ASP0022. Aynı route ve metoda eşlenmiş iki minimal API route handler’ını işaretler. İstekler belirsiz eşleşme hatasıyla düşer.

app.MapGet("/orders/{id}", (int id) => Find(id));
app.MapGet("/orders/{orderId}", (int orderId) => Load(orderId));
app.MapGet("/orders/{id}", (int id) => Find(id));
app.MapGet("/orders/{orderId}/lines", (int orderId) => Lines(orderId));