ComponentOne Data Source for Entity Framework
C1.LiveLinq Namespace / IndexedQueryExtensions Class / AsIndexed<T> Method
The type of the elements of source.
The collection to type as C1.LiveLinq.Indexing.IIndexedSource<T>.

In This Topic
    AsIndexed<T> Method (IndexedQueryExtensions)
    In This Topic
    Returns the input typed as C1.LiveLinq.Indexing.IIndexedSource<T>.
    Syntax
    '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
    )

    Parameters

    source
    The collection to type as C1.LiveLinq.Indexing.IIndexedSource<T>.

    Type Parameters

    T
    The type of the elements of source.

    Return Value

    The input collection typed as C1.LiveLinq.Indexing.IIndexedSource<T>.
    Remarks

    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.

    See Also