Language
Edit

EnumerableExtensions.DisposeElements<T>(IEnumerable<T>) Method

Definition

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.

Applies to