# Read by Primary Key

## Syntax

```
GetByID(id);
```

## Arguments

<table data-header-hidden><thead><tr><th width="152">Argument</th><th width="189">Data Type</th><th width="290">Description</th><th>Default Value</th></tr></thead><tbody><tr><td><em>id</em></td><td>string</td><td><p>Value of the Primary Key of the to-be-read record. </p><p>This parameter must not be empty.</p></td><td></td></tr></tbody></table>

## Description

Gets the specific record from a repository whose Primary Key value matches the one specified in the parameter _id_.&#x20;

Primary Key refers to the column of a data table that contains the identifier of each row (the value that unambiguously distinguishes a record from the rest), i.e. no two records can have the same Primary Key value. You can check which column is the Primary Key by opening the Entity file of the data table and see which property is preceded by "\[Key]".

If the input does not match the Primary Key of any record in the repository, an error will be thrown.

## Example

The following program illustrates the function call:

```
var orderSingle = repo.GetByID("EU00899091");
```

Function will load the specific record from the repository that has "EU00899091" as ID (the Primary Key of the data table "Production Orders") and store the result into the variable "orderSingle".
