AggregateOperand.Count() Method
Creates a new AggregateOperand which returns the count of AggregateOperand.CollectionProperty elements that match the AggregateOperand.Condition.
Namespace: DevExpress.Data.Filtering
Assembly: DevExpress.Data.v23.1.dll
NuGet Package: DevExpress.Data
Declaration
Returns
Type | Description |
---|---|
AggregateOperand | An AggregateOperand object which calculates an aggregate expression. |
Example
Example 1
Get amount of all orders.
Expression:
CriteriaOperator.FromLambda<Order, double>(x => FromLambdaFunctions.TopLevelAggregate<Order>().Count());
Test
Input:
Order |
---|
Order0 |
Order1 |
The result: 2
Example 2
Get orders with more than 1 order items.
Expression:
Test
Input:
Order | OrderItem |
---|---|
Order0 | |
Item0-0 | |
Item0-1 | |
Order1 | |
Item1-0 | |
Order2 | |
Item2-0 | |
Item2-1 |
The result:
Order |
---|
Order0 |
Order2 |
See Also