If you have worked with async methods in C#, you might have noticed that returning streams is not possible, or is hard to achieve with existing features. This would, however, be a helpful feature, which would make development tasks much simpler. This is why C# 8 has introduced a new interface called IAsyncEnumerable. With this new interface, asynchronous streams of data can be returned. Let me explain a little bit more about this.
Before async streams, in the C# programming language an async method was not able to return a stream of data—it could could only return a single value.
Let's take a look at an example of code that doesn't use an async stream:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ExploreVS
{
class Program
{
public static void Main(string[] args)
{
var numbers...