Returns the input typed as IEnumerable<T>.
Assembly: System.Core (in System.Core.dll)
[ExtensionAttribute] public: generic<typename TSource> static IEnumerable<TSource>^ AsEnumerable( IEnumerable<TSource>^ source )
The type of the elements of source.
Return ValueType: System.Collections.Generic::IEnumerable<>
The input sequence typed as IEnumerable<T>.
Usage NoteIn Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
can be used to choose between query implementations when a sequence implements IEnumerable<T> but also has a different set of public query methods available. For example, given a generic class Table that implements IEnumerable<T> and has its own methods such as Where, Select, and SelectMany, a call to Where would invoke the public Where method of Table. A Table type that represents a database table could have a Where method that takes the predicate argument as an expression tree and converts the tree to SQL for remote execution. If remote execution is not desired, for example because the predicate invokes a local method, the method can be used to hide the custom methods and instead make the standard query operators available.
.NET FrameworkSupported in: 4.5.2, 4.5.1, 4.5, 4, 3.5
.NET Framework Client ProfileSupported in: 4, 3.5 SP1
Portable Class LibrarySupported in: Portable Class Library
.NET for Windows Store appsSupported in: Windows 8
.NET for Windows Phone appsSupported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.