Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 427 Bytes

PH_S006.md

File metadata and controls

9 lines (5 loc) · 427 Bytes

PH_S006 - Unnecessarily Async Methods

Problem

Only the last instruction of the method's body will run asynchronously. However, asynchronous methods capture the synchronization context when ConfigureAwait(false) is not used. Therefore, unnecessary boilerplate code is created.

Solution

Remove the use of the await statement and get rid of the async method modifier and return the awaited task object directly.