> For the complete documentation index, see [llms.txt](https://vostok.gitbook.io/configuration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vostok.gitbook.io/configuration/sources/object-source.md).

# Object source

**Location**: [main sources module](/configuration/modules/sources.md).

[**ObjectSource**](https://github.com/vostok/configuration.sources/blob/master/Vostok.Configuration.Sources/Object/ObjectSource.cs) converts an arbitrary object (including anonymous types) to a [settings node](/configuration/concepts-and-basics/settings-nodes.md):

```
var source = new ObjectSource(new {A = 1, B = 2, C = new[] {1, 2, 3});
```

Conversion process obeys the following priority list:

* Objects with overridden `ToString` are converted to [value nodes](/configuration/concepts-and-basics/settings-nodes/value-nodes.md);
* Dictionaries with primitive key types are converted to [object nodes](/configuration/concepts-and-basics/settings-nodes/object-nodes.md);
  * Conversion is performed recursively for keys and values;
* Objects that implement `IEnumerable` are converted to [array nodes](/configuration/concepts-and-basics/settings-nodes/array-nodes.md);
  * Conversion is performed recursively for sequence elements;
* Everything else is converted to [object nodes](/configuration/concepts-and-basics/settings-nodes/object-nodes.md);
  * Conversion is performed recursively for public instance fields and properties;

Like [constant sources](/configuration/sources/constant-source.md), object source does not produce any updates by itself; conversion exceptions are exposed via `(null, error)` notifications.

### Related pages

{% content-ref url="/pages/-M6UQMklC2EtQ\_nAUDjI" %}
[Configuration sources](/configuration/concepts-and-basics/configuration-sources.md)
{% endcontent-ref %}
