How to Use IDisposable with LINQ

Objects that implement IDisposable are everywhere. The interface even gets its own language features (C#, VB, F#). However, LINQ throws a few wrenches into things: LINQ’s query syntax depends on expressions; using blocks are statements. When querying a sequence of IDisposable objects, there’s no easy way to ensure disposal after each element has been consumed. [...]

Share

Tags: , , , ,

Read Users' Comments (0)