Skip to content

Instantly share code, notes, and snippets.

@richlander
Created December 4, 2018 16:57
Show Gist options
  • Select an option

  • Save richlander/224803ce366bb653b6a1801e2b67f241 to your computer and use it in GitHub Desktop.

Select an option

Save richlander/224803ce366bb653b6a1801e2b67f241 to your computer and use it in GitHub Desktop.
Using IAsyncEnumerable
async IAsyncEnumerable<int> GetBigResultsAsync()
{
await foreach (var result in GetResultsAsync())
{
if (result > 20) yield return result;
}
}
@krchome
Copy link
Copy Markdown

krchome commented Aug 21, 2019

//The following is my full implementation of GetResultsAsync() method
//as well as how to consume GetBigResultsAsync() method from main() with testable code as follows
Capture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment