I have an interface which is written like this:
public interface IItemRetriever
{
public IAsyncEnumerable
If you install the System.Linq.Async package, you should be able to use AsyncEnumable.Empty
. Here's a complete example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
IAsyncEnumerable empty = AsyncEnumerable.Empty();
var count = await empty.CountAsync();
Console.WriteLine(count); // Prints 0
}
}