# 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.)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aeudoc.gitbook.io/developer/backend/data-repository.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
