Select
To begin working with an entity, start with the name of the entity. Use the select
method to begin a new query. This method returns a new instance of the entity class. When finished, use the execAsync
method to execute the query in the database and return the records as a strongly typed version of the WireBootstrap DataTable.
The example below will return all the records and fields in the Categories
table in the Northwind
database.
Note, the execAsync
method returns a TypeScript Promise
so the await
keyword can be used to execute the query asynchronously.
Fields
To select fields from an entity, use the [entity]Field enum
parameters on the select
method.
The field
method can also be used to select fields.
Filter
To filter the records returned, use the eq
method.
First
To return the first record in a result set, the execFirstAsync
method can be used instead of the execAsync
method.
Note, unlike the execAsync
method which returns a data table, this method returns a single Categories
object.
Scaler
When selecting a single cell in a query, the execScalerAsync
method can be used.
Order By
To order the records in the result set, use the orderBy
method.
Last updated