[]
A view representing the number of elements in a view.
public static AggregationView<T, int> LiveCount<T>(this View<T> source)
Type | Name | Description |
---|---|---|
View<T> | source | A view that contains elements to be counted. |
Type | Description |
---|---|
AggregationView<T, int> |
Name | Description |
---|---|
T | The type of the elements of source. |
It is possible to use standard LINQ query operator Count instead of LiveCount. Both are "live" in the sense that they are recomputed automatically when any change occurs in the source. The difference is that Count will every time loop through the entire source collection and aggregate it from scratch, whereas LiveCount will use a more performant algorithm, will maintain its value incrementally, processing only those source items that actually changed.
A view representing the number of elements of the specified view satisfying a condition.
public static AggregationView<T, int> LiveCount<T>(this View<T> source, Expression<Func<T, bool>> predicate)
Type | Name | Description |
---|---|---|
View<T> | source | A view that contains elements to be tested and counted. |
Expression<Func<T, bool>> | predicate | A function to test each element for a condition. |
Type | Description |
---|---|
AggregationView<T, int> |
Name | Description |
---|---|
T | The type of the elements of source. |
It is possible to use standard LINQ query operator Count instead of LiveCount. Both are "live" in the sense that they are recomputed automatically when any change occurs in the source. The difference is that Count will every time loop through the entire source collection and aggregate it from scratch, whereas LiveCount will use a more performant algorithm, will maintain its value incrementally, processing only those source items that actually changed.