IData ApiAny Method
Determines whether any element of a Data Collection exists or satisfies a condition.
Definition
Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
True if there is a Data Object satisfies the filter condition; otherwise, False.
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
C#
bool Any(
string dataClassName,
DynamicFilter filter
)Parameters
- dataClassName String
- The Data Class name.
- filter DynamicFilter
- Filter object that is built using FilterBuilder.
Return Value
BooleanTrue if there is a Data Object satisfies the filter condition; otherwise, False.
Example
C#
var dataApi = ctx.Use<IDataApi>();
var filter = FilterBuilder.Create()
.Eq("DepartmentId", ctx.Input.Id)
.Eq("Active", true)
.Build();
var any = dataApi.Any("Employee", filter);
if (any) Log.Info("There is Employee in the Department!!!");