[]
        
(Showing Draft Content)

C1.LiveLinq.IndexedQueryExtensions

IndexedQueryExtensions Class

Provides a set of static (extension) methods for querying objects that implement IIndexedSource<T>.

Inheritance
IndexedQueryExtensions
Namespace: C1.LiveLinq
Assembly: C1.LiveLinq.4.8.dll
Syntax
public static class IndexedQueryExtensions
Remarks

The methods in this class provide an implementation of the LINQ query operators for querying data sources that implement IIndexedSource<T>. Those data sources include LiveLinq to Objects, LiveLinq to DataSet and LiveLinq to XML, see How to query collections with LiveLinq.

These implementations of query operators use indexing and other optimization techniques to speed up query execution.

Not all standard LINQ query operators are present here, but it does not mean that they cannot be used in the same query. For the operators that are not present here, standard LINQ implementations are used, because they don't require or don't allow optimization.

Note: Live views are also LiveLinq data sources, but they have their own implementations of query operators defined in the 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 View<T>, use AsIndexed<T>(IIndexedSource<T>) to "downgrade" the live view to an IIndexedSource<T>.

Methods

Name Description
AsIndexed<T>(IIndexedSource<T>)

Returns the input typed as IIndexedSource<T>.

GroupBy<TSource, TKey>(IIndexedSource<TSource>, Expression<Func<TSource, TKey>>)

Groups the elements of a collection according to a specified key selector function.

GroupBy<TSource, TKey, TElement>(IIndexedSource<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>)

Groups the elements of a collection according to a specified key selector function and projects the elements for each group by using a specified function.

GroupBy<TSource, TKey, TResult>(IIndexedSource<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TKey, IEnumerable<TSource>, TResult>>)

Groups the elements of a collection according to a specified key selector function and creates a result value from each group and its key.

GroupBy<TSource, TKey, TElement, TResult>(IIndexedSource<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>, Expression<Func<TKey, IEnumerable<TElement>, TResult>>)

Groups the elements of a collection according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function.

GroupJoin<TOuter, TInner, TKey, TResult>(IIndexedSource<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, IEnumerable<TInner>, TResult>>)

Correlates the elements of two collections based on equality of keys and groups the results.

Join<TOuter, TInner, TKey, TResult>(IIndexedSource<TOuter>, IIndexedSource<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner, TResult>>)

Correlates the elements of two collections based on matching keys.

Join<TOuter, TInner, TKey, TResult>(IIndexedSource<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner, TResult>>)

Correlates the elements of two collections based on matching keys.

Join<TOuter, TInner, TKey, TResult>(IEnumerable<TOuter>, IIndexedSource<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner, TResult>>)

Correlates the elements of two collections based on matching keys.

OrderByDescending<T, TKey>(IIndexedSource<T>, Expression<Func<T, TKey>>)

Sorts the elements of a collection in descending order.

OrderBy<T, TKey>(IIndexedSource<T>, Expression<Func<T, TKey>>)

Sorts the elements of a collection in ascending order.

SelectMany<TSource, TResult>(IIndexedSource<TSource>, Expression<Func<TSource, IEnumerable<TResult>>>)

Projects each element of a collection to a sequence of collections and flattens the resulting collections into one collection.

SelectMany<TSource, TCollection, TResult>(IIndexedSource<TSource>, Expression<Func<TSource, IEnumerable<TCollection>>>, Expression<Func<TSource, TCollection, TResult>>)

Projects each element of a collection to a sequence of collections, flattens the resulting collections into one collection, and invokes a result selector function on each element therein.

Select<TSource, TResult>(IIndexedSource<TSource>, Expression<Func<TSource, TResult>>)

Projects each element of a collection into a new form.

ToIndexed<T>(IObservableSource<T>)

Creates an IIndexedSource<T> based on the specified IObservableSource<T> collection.

ToIndexed<T>(BindingList<T>)

A typed specialization of the ToIndexed<T>(IBindingList) method.

ToIndexed<T>(IBindingList)

Creates an IndexedCollection<T> based on the specified IBindingList data source.

Where<T>(IIndexedSource<T>, Expression<Func<T, bool>>)

Filters the source collection based on a predicate.

Where<T>(IIndexedSource<T>, Expression<Func<T, bool>>, bool)

Filters the source collection based on a predicate, preserving the order of the source collection.