IData ApiCount Method
Count the Data Objects that satisfies a condition.
Definition
Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
The number of Data Objects that satisfies the condition.
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
C#
long Count(
string dataClassName,
DynamicFilter filter
)Parameters
- dataClassName String
- The Data Class name.
- filter DynamicFilter
- Filter object that is built using FilterBuilder.
Return Value
Int64The number of Data Objects that satisfies the condition.
Example
C#
var dataApi = ctx.Use<IDataApi>();
var filter = FilterBuilder.Create()
.Eq("DepartmentId", ctx.Input.Id)
.Eq("Active", true)
.Build();
var count = dataApi.Count("Employee", filter);
Log.Info("There are {Count} Employees in the Department", count);