ComponentOne Data Source for Entity Framework
ComponentOne LiveLinq / How to Use LiveLinq / Query Collection / LiveLinq to Objects: IndexedCollection and other collection classes
In This Topic
    LiveLinq to Objects: IndexedCollection and other collection classes
    In This Topic

    Querying general collection classes in LiveLinq is called LiveLinq to Objects, to distinguish it from LiveLinq to DataSet and LiveLinq to XML that query such specific data sources as DataSet and XML. So use LiveLinq to DataSet if you need to query data in a DataSet and LiveLinq to XML if your data is in XML. For other cases, we already saw two options in LiveLinq to Objects:

    1. Use IndexedCollection<T> if you don't have preexisting collection classes and rely on LiveLinq to supply them.
    2. Apply ToIndexed() to preexisting collection classes that support data binding.

      And there is also a more advanced option that is not frequently needed:

    3. Define your own collection class, usually derived from  IndexedCollection<T>, if you want some non-standard functionality.

      And finally, an option that can also be considered advanced, but, actually, is not particularly difficult, and allows you to bring virtually any collection into the LiveLinq orbit:

    4. You can make any existing collection class C usable in LiveLinq provided that it somehow lets you know when changes occur. Then you can create an adapter class implementing the C1.LiveLinq.IObservableSource<T> interface and delegating most of its functionality to that preexisting collection class. Having an IObservableSource<T> implementation, you can apply the ToIndexed() extension method to it, it will return IIndexedSource<T>. LiveLinq extension methods implementing query operators take IIndexedSource<T> as their argument, see IndexedQueryExtensions.