C# Error CS8403 – Method ‘{0}’ with an iterator block must be ‘async’ to return ‘{1}’

C# Error

CS8403 – Method ‘{0}’ with an iterator block must be ‘async’ to return ‘{1}’

Reason for the Error & Solution

Method ‘method’ with an iterator block must be ‘async’ to return ‘{IAsyncEnumerable<T>|IAsyncEnumerator<T>}’

To correct this error

Mark your method with the async modifier.