# Assign sources to types

**Requires**: [main module](https://vostok.gitbook.io/configuration/modules/configuration).

When using [configuration providers](https://vostok.gitbook.io/configuration/concepts-and-basics/configuration-provider), **Get** and **Observe** method overloads without parameters require an explicit association of the model type with a [configuration source](https://vostok.gitbook.io/configuration/concepts-and-basics/configuration-sources).

```
// This simply won't work (no source defined):

provider.Get<MySettings>();
provider.Observe<MySettings>();
```

```
// This will work as expected:

provider.SetupSourceFor<MySettings>(new JsonFileSource("settings.json"));

provider.Get<MySettings>();
provider.Observe<MySettings>();
```

A source can only be assigned to a type before any **Get** or **Observe** calls are made for that type:

```
provider.SetupSourceFor<MySettings>(source1); // succeeds

provider.SetupSourceFor<MySettings>(source2); // succeeds, overwrites

provider.Get<MySettings>();

provider.SetupSourceFor<MySettings>(source3); // fails
```

&#x20;


---

# 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://vostok.gitbook.io/configuration/basic-scenarios/assign-sources-to-types.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.
