Topic | Value |
---|---|
Id | ASP011 |
Severity | Warning |
Enabled | True |
Category | AspNetCoreAnalyzers.Routing |
Code | AttributeAnalyzer |
Route parameter appears more than once.
[HttpGet(""api/{id}/{id}"")]
public IActionResult GetId(string id)
{
return this.Ok(id);
}
Have the parameter only in one place.
Configure the severity per project, for more info see MSDN.
#pragma warning disable ASP011 // Route parameter appears more than once
Code violating the rule here
#pragma warning restore ASP011 // Route parameter appears more than once
Or put this at the top of the file to disable all instances.
#pragma warning disable ASP011 // Route parameter appears more than once
[System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing",
"ASP011:Route parameter appears more than once",
Justification = "Reason...")]