Do I need to consider disposing of any IEnumerable<T> I use?
问题 It's recently been pointed out to me that various Linq extension methods (such as Where , Select , etc) return an IEnumerable<T> that also happens to be IDisposable . The following evaluates to True new int[2] {0,1}.Select(x => x*2) is IDisposable Do I need to dispose of the results of a Where expression? Whenever I call a method returning IEnumerable<T> , am I (potentially) accepting responsibility for calling dispose when I've finished with it? 回答1: No, you don't need to worry about this.