Click or drag to resize

IDataApiSearch Method (DataSourceApiQuery)

Search Data Objects from a Data Source.

Namespace:  Casewhere.Runtime.DSL.Api
Assembly:  Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.1.0
Syntax
C#
DynamicQueryResult Search(
	DataSourceApiQuery query
)

Parameters

query
Type: Casewhere.Runtime.DSL.ApiDataSourceApiQuery
The search query.

Return Value

Type: DynamicQueryResult
Collection of Data Objects.
Examples
var dataApi = ctx.Use<IDataApi>();
var filter = FilterBuilder.Create().Eq("DepartmentId", ctx.Input.Id).Eq("Active", true).Build();
var result = dataApi.Search(DataSourceApiQuery
    .For("EmployeesWithDepartments")
    .FilterBy(filter));

Log.Info("Total: {TotalItems}", result.TotalItems);
foreach(var emp in result.Data)
    Log.Info("{DepartmentName}", emp.Department.Name);
See Also