You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Diagnostic Id: CC0061: Asynchronous method can be terminated with the 'Async' keyword.
Category: Style
Severity: Info
Triggering Code:
using Microsoft.AspNetCore.Mvc;
...
public class ForgotPasswordController : Controller
{[HttpGet]publicasyncTask<IActionResult>Index(){await _signInManager.SignOutAsync();
_logger.LogInformation("User logged out.");return View();}}
When a class inherits from Microsoft.AspNetCore.Mvc.Controller and a public method in the class returns Task<IActionResult> the analyzer should not be triggered. Alternatively if a method is marked with [HttpGet], [HttpPost], etc. the analyzer should not pop.
BUG:
Adding a global suppression with scope NamespaceAndDescendants does not suppress the analyzer.
[assembly:System.Diagnostics.CodeAnalysis.SuppressMessage("Style","CC0061:Asynchronous method can be terminated with the 'Async' keyword.", Justification ="Public Controller Actions do not need to be named with Async.", Scope ="NamespaceAndDescendants", Target ="CPCA.WebUI.Features")]
The text was updated successfully, but these errors were encountered:
Diagnostic Id:
CC0061
: Asynchronous method can be terminated with the 'Async' keyword.Category:
Style
Severity:
Info
Triggering Code:
When a class inherits from
Microsoft.AspNetCore.Mvc.Controller
and a public method in the class returnsTask<IActionResult>
the analyzer should not be triggered. Alternatively if a method is marked with[HttpGet]
,[HttpPost]
, etc. the analyzer should not pop.BUG:
Adding a global suppression with scope
NamespaceAndDescendants
does not suppress the analyzer.The text was updated successfully, but these errors were encountered: