In a method which is already asynchronous, calls to other methods should be to their async versions, where they exist.
Task DoAsync()
{
file.Read(buffer, 0, 10);
}
All methods where an Async-suffixed equivalent exists will produce this warning
when called from a Task
-returning method.
In addition, calling Task.Wait()
, Task<T>.Result
or Task.GetAwaiter().GetResult()
will produce this warning.
Await the async version of the method:
async Task DoAsync()
{
await file.ReadAsync(buffer, 0, 10);
}