Converts an IEnumerable to an IQueryable.
<ExtensionAttribute> _ Public Shared Function AsQueryable ( _ source As IEnumerable _ ) As IQueryable
Dim source As IEnumerable Dim returnValue As IQueryable returnValue = source.AsQueryable()
public static IQueryable AsQueryable( this IEnumerable source )
[ExtensionAttribute] public: static IQueryable^ AsQueryable( IEnumerable^ source )
public static function AsQueryable( source : IEnumerable ) : IQueryable
source does not implement IEnumerable<(Of <(T>)>) for some T.
source is nullNothingnullptra null reference (Nothing in Visual Basic).
If the type of source implements IQueryable<(Of <(T>)>), AsQueryable(IEnumerable) returns it directly. Otherwise, it returns an IQueryable<(Of <(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<(Of <(T>)>) for some T. At runtime, the result is of type IQueryable<(Of <(T>)>) for the same T. This method is useful in dynamic scenarios when you do not statically know the type of T.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003