EnumerableExtensions.DisposeElements<T>(IEnumerable<T>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Disposes of all non-null elements in a collection.
public static void DisposeElements<T>(this System.Collections.Generic.IEnumerable<T> items) where T : IDisposable;
static member DisposeElements : seq<'T (requires 'T :> IDisposable)> -> unit (requires 'T :> IDisposable)
<Extension()>
Public Sub DisposeElements(Of T As IDisposable) (items As IEnumerable(Of T))
Type Parameters
- T
The type of the items in the collection.
Parameters
- items
- IEnumerable<T>
The collection of items to be disposed.