# Insert Record

## Syntax

```
Insert(entity);
```

## Arguments

<table data-header-hidden><thead><tr><th width="162">Argument</th><th width="118">Data Type</th><th width="327">Description</th><th>Default Value</th></tr></thead><tbody><tr><td><em>entity</em></td><td>T</td><td><p>Entity that should be inserted into the repository.</p><p>It needs to be of the same type as the records of the data table it will be inserted into. </p><p>This parameter must not be empty.</p></td><td></td></tr></tbody></table>

## Description

Inserts a new record into the repository.

Before calling the function, you need to create a new instance of the respective Entity object with the values you want it to have. (To generate a new Primary Key value, use the function "NewID" that is explained in the article "Generate Row-Id".)

## Example

The following program illustrates the function call after creating the record to be inserted:

```
var orderInstance = new ProductionOrder()
{
    ID = repo.NewID(x => x.ID),
    ProductID = "ADAM-567-BTO",
    Timestamp = DateTime.Now,
    //...
};

repo.Insert(orderInstance);

```

Function will insert the newly created Production Order "orderInstance" into the repository "repo".

