System.Linq.AsyncEnumerable
$ dotnet add package System.Linq.AsyncEnumerableThe System.Linq.AsyncEnumerable library provides support for Language-Integrated Query (LINQ) over IAsyncEnumerable<T> sequences.
IAsyncEnumerable<T> sequences.using System;
using System.IO;
using System.Linq;
static IAsyncEnumerable<City> DeserializeAndFilterData(Stream stream)
{
IAsyncEnumerable<City> cities = JsonSerializer.DeserializeAsyncEnumerable<City>(stream);
return from city in cities
where city.Population > 10_000
orderby city.Name
select city;
}
The main type provided by this library is:
System.Linq.AsyncEnumerableSystem.Linq.AsyncEnumerable is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.