Class ExtensionMethods.CastingEnumerable<T>
Converts a non-generic IEnumerable instance to a generic
IEnumerable<T> by casting each element to T.
public class ExtensionMethods.CastingEnumerable<T> : IEnumerable<T>, IEnumerable
Type Parameters
TThe type to cast the items in the non-generic enumerable to.
- Inheritance
-
ExtensionMethods.CastingEnumerable<T>
- Implements
-
IEnumerable<T>
- Inherited Members
- Extension Methods
Constructors
CastingEnumerable(IEnumerable)
Initializes a new instance of the ExtensionMethods.CastingEnumerable<T> class.
public CastingEnumerable(IEnumerable nonGenericEnumerable)
Parameters
nonGenericEnumerableIEnumerableThe non generic enumerable.
Methods
GetEnumerator()
Returns an enumerator that returns the items in the original non-generic enumerator
casted to T.
public IEnumerator<T> GetEnumerator()
Returns
- IEnumerator<T>
A generic enumerator returning the items from the original non-generic enumerator.