AggregateOperand.Count() Method
In This Article
Creates a new AggregateOperand which returns the count of AggregateOperand.CollectionProperty elements that match the AggregateOperand.Condition.
Namespace: DevExpress.Data.Filtering
Assembly: DevExpress.Data.v24.2.dll
NuGet Package: DevExpress.Data
#Declaration
public AggregateOperand Count()
#Returns
Type | Description |
---|---|
Aggregate |
An Aggregate |
#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 | Order |
---|---|
Order0 | |
Item0-0 | |
Item0-1 | |
Order1 | |
Item1-0 | |
Order2 | |
Item2-0 | |
Item2-1 |
The result:
Order |
---|
Order0 |
Order2 |
See Also