IEnumerable Interface
Exposes the enumerator, which supports a simple iteration over a non-generic collection.
Assembly: mscorlib (in mscorlib.dll)
The IEnumerable type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | AsParallel | Enables parallelization of a query. (Defined by ParallelEnumerable.) |
![]() ![]() | AsQueryable | Converts an IEnumerable to an IQueryable. (Defined by Queryable.) |
![]() ![]() ![]() | Cast(TResult) | Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) |
![]() ![]() ![]() | OfType(TResult) | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
For the generic version of this interface see System.Collections.Generic.IEnumerable(T).
Notes to ImplementersIEnumerable must be implemented to support the foreach semantics of Microsoft Visual Basic. COM classes that allow enumerators also implement this interface.
The following code example demonstrates the implementation of the IEnumerable and IEnumerator interfaces for a custom collection. In this example, members of these interfaces are not explicitly called, but they are implemented to support the use of foreach (For Each in Visual Basic) to iterate through the collection.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

