# Data Repository

## General information

Data repository refers to the functionality of loading data from any data source (e.g. data table, excel file, API endpoint, ...) into a repository that you can interact with using different functions.

The following sub-articles cover the functions provided to interact with a repository, which can be found in the file "IRepository.cs" in the Data directory of each project.

## How to use

To be able to use these functions on a repository, the data you want to use needs to be loaded from the database into the repository first. This is done in the following way:&#x20;

```
var dataContext = new DataContext();
var repo = new Repository<ProductionOrder>(dataContext);
```

The code above loads the table of the Entity "Production Order" from the database into the newly created repository "repo". (This is also the repository that will be used in the examples in the following sub-articles.)

