Using IAsyncEnumerable with Dapper
问题 We have recently migrated our ASP.NET Core API which uses Dapper to .NET Core 3.1. After the migration, we felt there was an opportunity to use the latest IAsyncEnumerable feature from C# 8 for one of our endpoints. Here is the pseudocode before the changes: public async Task<IEnumerable<Item>> GetItems(int id) { var reader = await _connection.QueryMultipleAsync(getItemsSql, param: new { Id = id }); var idFromDb = (await reader.ReadAsync<int?>().ConfigureAwait(false)).SingleOrDefault(); if