title: Read text file with IAsyncEnumerable
body: <p>I came across IAsyncEnumerable while I am testing C# 8.0 features. I found remarkable examples from  Anthony Chu (<a href="https://anthonychu.ca/post/async-streams-dotnet-core-3-iasyncenumerable/" rel="noreferrer">https://anthonychu.ca/post/async-streams-dotnet-core-3-iasyncenumerable/</a>). It is async stream and replacement for <code>Task&lt;IEnumerable&lt;T&gt;&gt;</code></p>
  
  <pre><code>// Data Access Layer.
  public async IAsyncEnumerable&lt;Product&gt; GetAllProducts()
  {
      Container container = cosmosClient.GetContainer(DatabaseId, ContainerId);
      var iterator = container.GetItemQueryIterator&lt;Product&gt;("SELECT * FROM c");
      while (iterator.HasMoreResults)
      {
          foreach (var product in await iterator.ReadNextAsync())
          {
              yield return product;
          }
      }
  }
  
  // Usage
  await foreach (var product in productsRepository.GetAllProducts())
  {
      Console.WriteLine(product);
  }
  </code></pre>
  
  <p>I am wondering if this can be applied to read text files like below usage that read file line by line.</p>
  
  <pre><code>foreach (var line in File.ReadLines("Filename"))
  {
      // ...process line.
  }
  </code></pre>
  
  <p>I really want to know how to apply async with <code>IAsyncEnumerable&lt;string&gt;()</code> to the above foreach loop so that it streams while reading.</p>
  
  <p>How do I implement iterator so that I can use yield return to read line by line?</p>