C1.LiveLinq Namespace > IndexedQueryExtensions Class : AsIndexed<T> Method |
'Declaration Public Shared Function AsIndexed(Of T)( _ ByVal source As IIndexedSource(Of T) _ ) As IIndexedSource(Of T)
public static IIndexedSource<T> AsIndexed<T>( IIndexedSource<T> source )
This method has no effect other than to change the compile-time type of source from a type that implements C1.LiveLinq.Indexing.IIndexedSource<T> to C1.LiveLinq.Indexing.IIndexedSource<T> itself. It is used to choose between query implementations when a collection implements C1.LiveLinq.Indexing.IIndexedSource<T> but also has a different set of public query methods available.
The main scenario is when you want to perform queries on live views without creating new live views.
Live views have their own implementations of query operators defined in the C1.LiveLinq.LiveViews.View<T> class. Live view implementations are heavier, require more resources, so it is not recommended to use live view implementations in cases where you don't need live view functionality (for example, for querying read-only collections), see Live View Performance. If you have a live view, but want to query it using operators from IndexedQueryExtensions instead of C1.LiveLinq.LiveViews.View<T>, use this method to "downgrade" the live view to an C1.LiveLinq.Indexing.IIndexedSource<T>. This method does not cause the live view to lose its "live" functionality, it simply returns the live view's implementation of the C1.LiveLinq.Indexing.IIndexedSource<T> interface.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2