using System.Threading.Tasks;
using System.Collections.Generic;
public static async Task Main()
var enumeration = AsyncEnumeration(-1);
await foreach(int x in enumeration)
public static IAsyncEnumerable<int> AsyncEnumeration(int count)
throw new ArgumentOutOfRangeException();
return AsyncEnumerationCore(count);
private static async IAsyncEnumerable<int> AsyncEnumerationCore(int count)
for(int i = 0; i < count; i++)