davidfowl / AspNetCoreDiagnosticScenarios

This repository has examples of broken patterns in ASP.NET Core applications
7.69k stars 740 forks source link

Analyzer for “Prefer async/await over directly returning Task”? #67

Closed atifaziz closed 3 years ago

atifaziz commented 3 years ago

Anyone aware of a Roslyn-based analyzer for the guidance “Prefer async/await over directly returning Task”?


/cc @p-schuler

gfoidl commented 3 years ago

The closet I know is RCS1229: Use async/await when necessary from Roslynator.

atifaziz commented 3 years ago

Thanks, @gfoidl! That seems to come pretty and will take it for a spin. On first looks, it caters for using statement/declaration mostly but might need extending to the general try-catch/-finally case that seems to be missing.