Read All Columns
Syntax
Arguments
filter
Expression<Func<T, bool>>
Criteria by which the records of the repository should be filtered.
This parameter must not be empty.
null
orderBy
Func<IQueryable, IOrderedQueryable>
Order in which the filtered records should be listed.
This parameter is optional.
null
includeProperties
string
Navigation properties (recognized by the key word "virtual") that should be included.
This parameter is optional.
""
rows
int
Maximal number of records that should be filtered.
This parameter is optional.
0
Description
Gets all records from a repository that fulfill the criteria specified in the parameter filter. (Because it loads all columns instead of just specific ones, it is usually slower than "GetFields".)
If orderBy is not null, it first orders the records according to the attributes specified in the parameter orderBy before getting the records from the newly ordered list.
If includeProperties is not null, it additionally loads the navigation properties that are specified in the parameter includeProperties. Navigation properties are "virtual" properties of the repository, i.e. they are not real properties and are accessed by navigating to another object. They would not get loaded unless specified in this parameter.
If rows is not 0, it makes sure that the number of filtered records does not exceed the specified number.
Example
Example 1: Filtering records by only one criterion
The following program illustrates the function call with only one criterion:
Function will load all the records from the repository that have "ADAM-567-BTO" as Production ID and store the result into the variable "orderList".
Example 2: Filtering records by multiple criteria
The following program illustrates the function call with multiple criteria:
Function will load all the records from the repository that have "ADAM-567-BTO" as Production ID, have a Quantity of more than 10 and are Urgent, and store the result into the variable "orderList".
Example 3: Filtering records by multiple criteria with order
The following program illustrates the function call with multiple criteria and specified order:
Function will order the records by their Timestamp attribute, load all the records from the ordered repository that have "ADAM-567-BTO" as Production ID and a Quantity of more than 10, and store the result into the variable "orderList".
Example 4: Filtering records by multiple criteria with order + maximum limit
The following program illustrates the function call with multiple criteria, specified order and maximum limit:
Function will order the records by their Timestamp attribute, load a maximum of 100 records from the ordered repository that have "ADAM-567-BTO" as Production ID and a Quantity of more than 10, and store the result into the variable "orderList".
Example 5: Filtering records by multiple criteria with order + maximum limit and including an virtual property
The following program illustrates the function call with multiple criteria, specified order, maximum limit and external property:
Function will order the records by their Timestamp attribute, load a maximum of 100 records from the ordered repository that have "ADAM-567-BTO" as Production ID and a Quantity of more than 10, include the virtual property "SapOrder" (a navigation property of "Production Order") and store the result into the variable "orderList".
Last updated