Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
C# IAsyncEnumerable, await foreach and Async Dispose
Collecting books from a paged API with Task<List<T>> leaves the first element until last; with an async iterator, yield return and await together let the first page flow right away. What await foreach expands to and MoveNextAsync's ValueTask, EnumeratorCancellation and CS8425, the finally that runs on break, IAsyncDisposable and await using, DeserializeAsyncEnumerable and streaming in ASP.NET Core.
Buffered and Unbuffered Reads in Dapper: Streaming Large Result Sets
We measure the difference between buffered and unbuffered reads in Dapper: an unbuffered result re-running the query on every enumeration, 191 MB versus near-zero memory on a million rows, IAsyncEnumerable streaming with QueryUnbufferedAsync, cancellation with WithCancellation and the disposed-connection trap, all with real output.