Topic | Value |
---|---|
Id | ASP007 |
Severity | Warning |
Enabled | True |
Category | AspNetCoreAnalyzers.Routing |
Code | AttributeAnalyzer |
The method has no corresponding parameter.
[HttpGet(""api/orders/{id}"")]
public async Task<IActionResult> GetOrder()
{
...
}
In the abobe there should be a parameter named id
[HttpGet(""api/orders/{id}"")]
public async Task<IActionResult> GetOrder(int id)
{
...
}
Configure the severity per project, for more info see MSDN.
#pragma warning disable ASP007 // The method has no corresponding parameter
Code violating the rule here
#pragma warning restore ASP007 // The method has no corresponding parameter
Or put this at the top of the file to disable all instances.
#pragma warning disable ASP007 // The method has no corresponding parameter
[System.Diagnostics.CodeAnalysis.SuppressMessage("AspNetCoreAnalyzers.Routing",
"ASP007:The method has no corresponding parameter",
Justification = "Reason...")]