Using() block hell in C#
So the other day I was working on transforming streams for an encryption layer for work. I ended up having some code that looked similar to this: public async Task SendAsync(byte[] data, Delegate next) { using (var stream = ...) { using (var encryptStream = ...) { using (var encodeStream = ...) { using (var reader = ...) { await next(...); } } } } } publi…