Vostok.Configuration
HomeQuickstartConcepts and basicsBasic scenarios
  • Home
  • Quickstart
  • Concepts and basics
    • Settings nodes
      • Value nodes
      • Array nodes
      • Object nodes
    • Settings nodes merging
    • Settings nodes scoping
    • Binding nodes to models
    • Configuration sources
    • Configuration provider
    • Caching and performance
    • Error handling
  • Modules
    • Abstractions
    • Configuration
    • Sources
    • Sources.CC
    • Sources.Json
    • Sources.Yaml
    • Sources.Xml
    • Sources.Vault
    • Logging
    • Microsoft
  • Sources
    • Constant sources
    • Object source
    • XML sources
    • YAML sources
    • JSON sources
    • Vault source
    • ClusterConfig source
    • Command line source
    • Environment variables source
  • Binders
    • Primitives
    • Collections
    • Classes and structs
    • Constructor injection
  • Basic scenarios
    • Assign sources to types
    • Obtain settings from provider
    • Observe settings via provider
    • Print settings
    • Log settings updates
    • Log errors
    • Combine sources
    • Scope sources
    • Make settings secret
    • Make settings required
  • Advanced scenarios
    • Use name aliases
    • Use dynamic interfaces
    • Use shared provider instance
    • Use value substitutions
    • Nest sources
    • Freeze sources
    • Transform sources
    • Create custom sources
    • Apply custom validators
    • Apply custom binders
    • Apply source data to existing object
    • Print contents of a source
Powered by GitBook
On this page
  • Overview
  • Methods
  • Related pages

Was this helpful?

Export as PDF
  1. Concepts and basics

Configuration provider

PreviousConfiguration sourcesNextCaching and performance

Last updated 4 years ago

Was this helpful?

Overview

is responsible for the and offers methods to obtain final settings models. It's also responsible for and . Providers are used directly by the application code to either or .

Methods

Get method

Fetches the newest version of settings of given type:

var settings = provider.Get<MySettings>();

Observe method

Allows to subscribe for updates of settings of given type:

provider.Observe<MySettings>.Subscribe(newSettings => {});

Overloads

Both Get and Observe methods have 2 variations:

  • The one without any parameters requires a prior of a source to the requested type;

  • The one with a parameter requires no such assignment (check out for gotchas);

Related pages

Configuration provider
binding process
caching
error handling
obtain settings on demand
subscribe to updates
assignment
source
caching
Obtain settings from provider
Observe settings via provider
Binding nodes to models
Configuration sources
Assign sources to types
Caching and performance
Error handling