The result of awaitable method should be observed by using await
, Result
, Wait
, or other methods.
Note: CS4014 is similar but only operate in async
methods. MA0134 operates in non-async methods.
void Sample()
{
Task.Delay(1); // non-compliant
Task.Delay(1).Wait(); // ok
_ = Task.Delay(1); // ok
}