تخطَّ إلى المحتوى

Route conflict between controller actions (ASP0023)

هذا المحتوى غير متوفر بلغتك بعد.

Key dotnet.api.action-route-conflict · Severity warning · Category api

ASP.NET Core analyzer ASP0023. Flags two controller actions with the same route and HTTP method. Requests fail with an ambiguous-match error.

[HttpGet("{id}")]
public IActionResult Get(int id) => Ok();
[HttpGet("{orderId}")]
public IActionResult Load(int orderId) => Ok();
[HttpGet("{id}")]
public IActionResult Get(int id) => Ok();
[HttpGet("{orderId}/lines")]
public IActionResult Lines(int orderId) => Ok();