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.
Remove the use of the await
statement and get rid of the async
method modifier and return the awaited task object directly.