What problem are you trying to solve?
Today I've encountered the following code:
var results = context.Entities
.Where(o => blablalba))
.ToAsyncEnumerable();
await foreach (var chunk in results.Chunk(100))
{
// DoSmthAsync in chunks
}
It looks perfectly fine on first glance, but it, if fact, has an issue - ToAsyncEnumerable works on IEnumerable argument, and it causes sync iteration over IQuearyble.
It should've been AsAsyncEnumerable instead.
Describe the solution you'd like
Add analyzer to warn against ToAsyncEnumerable usage on IQueryable, and suggest to use AsAsyncEnumerable instead.