Queryable::AsQueryable Method (IEnumerable)
Assembly: System.Core (in System.Core.dll)
- Type: System.Collections::IEnumerable
A sequence to convert.
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).
If the type of source implements IQueryable<T>, returns it directly. Otherwise, it returns an IQueryable<T> that executes queries by calling the equivalent query operator methods in Enumerable instead of those in Queryable.
This method assumes that source implements IEnumerable<T> for some T. At runtime, the result is of type IQueryable<T> for the same T. This method is useful in dynamic scenarios when you do not statically know the type of T.
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.