title: Clarification on how IAsyncEnumerable works with ASP.NET Web API
body: <p>I encountered an interesting behavior while exploring IAsyncEnumerable in an ASP.NET Web API project.
  Consider the following code samples:</p>
  
  <pre><code>    // Code Sample 1
      [HttpGet]
      public async IAsyncEnumerable&lt;int&gt; GetAsync()
      {
          for (int i = 0; i &lt; 10; i++)
          {
              await Task.Delay(1000);
              yield return i;
          }
      }
  
  
      // Code Sample 2
      [HttpGet]
      public async IAsyncEnumerable&lt;string&gt; GetAsync()
      {
          for (int i = 0; i &lt; 10; i++)
          {
              await Task.Delay(1000);
              yield return i.ToString();
          }
      }
  </code></pre>
  
  <p>Sample 1 (int array) returns <code>{}</code> as JSON result.</p>
  
  <p>Sample 2 returns expected result <code>["0","1","2","3","4","5","6","7","8","9"]</code>. However, entire JSON array is returned at once after 10 seconds of wait. Shouldn't it be returned as data becomes available as expected from IAsyncEnumerable interface? Or is there any specific way this web api should be consumed?</p>