Bindable LINQ Concepts
Bindable LINQ is implemented as a set of .NET extension methods, each of which is described as being a seperate query operator. Since Bindable LINQ can be used hand-in-hand with LINQ to Objects and other LINQ query providers, even within the same file, an AsBindable extension method is used to tell the C# compiler that every LINQ operator coming after it should use Bindable LINQ extensions instead of LINQ to Objects.
var query = items.Where(c => c.FirstName == "Paul") // Uses LINQ var query = items.AsBindable().Where(c => c.FirstName == "Paul") // Uses Bindable LINQ
Bindable LINQ query operators can be broadly broken into three categories:
- Iterators
Iterators are Bindable LINQ queries that transform a collection of items into another collection of items. Examples of such queries include Select, Where, OrderBy, Distinct and UnionAll. - Aggregators
Aggregators are Bindable LINQ queries which transform a collection of items into a singular item. Examples of such queries include Min, Max, Count and First. - Operators
Operators are Bindable LINQ queries which transform a singular item into another singular item. Examples of such queries include Switch, which is used for pattern matching (like the native C# switch statement, or the functional F# match operator), and Project (which turns one item into another, like a single-value Select statement).
All Bindable LINQ query extension methods are defined in the BindableEnumerable class in the Bindable.Linq namespace.
The following pages contain more information on Bindable LINQ: