# Read All Columns

## Syntax

```
Get(filter, orderBy, includeProperties, rows);
```

## Arguments

<table data-header-hidden><thead><tr><th width="181">Argument</th><th width="189">Data Type</th><th width="282">Description</th><th>Default Value</th></tr></thead><tbody><tr><td><em>filter</em></td><td>Expression&#x3C;Func&#x3C;T, bool>></td><td><p>Criteria by which the records of the repository should be filtered. </p><p>This parameter must not be empty. </p></td><td>null </td></tr><tr><td><p><em>orderBy</em></p><p> </p></td><td>Func&#x3C;IQueryable, IOrderedQueryable></td><td><p>Order in which the filtered records should be listed. </p><p>This parameter is optional.</p></td><td>null </td></tr><tr><td><em>includeProperties</em></td><td>string</td><td><p>Navigation properties (recognized by the key word "virtual") that should be included. </p><p>This parameter is optional.</p></td><td>""</td></tr><tr><td><em>rows</em></td><td>int</td><td><p>Maximal number of records that should be filtered. </p><p>This parameter is optional.</p></td><td>0</td></tr></tbody></table>

## 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.&#x20;

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:

```
var orderList = repo.Get(x => x.ProductID == "ADAM-567-BTO");
```

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:

```
var orderList = repo.Get(x => x.ProductID == "ADAM-567-BTO" 
                           && x.Quantity > 10 
                           && x.IsUrgent == true);
```

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:

```
var orderList = repo.Get(x => x.ProductID == "ADAM-567-BTO" 
                           && x.Quantity > 10, 
                       o => o.OrderBy(c => c.Timestamp);
```

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:

```
var orderList = repo.Get(x => x.ProductID == "ADAM-567-BTO" 
                           && c.Quantity > 10, 
                         o => o.OrderBy(c => c.Timestamp), 
                         "",
                         100);
```

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:

```
var orderList = repo.Get(x => x.ProductID == "ADAM-567-BTO" 
                           && c.Quantity > 10, 
                         o => o.OrderBy(c => c.Timestamp), 
                         "SapOrder",
                         100);
```

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".

