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
  • Supported types
  • Binder requirements
  • Node requirements
  • Null node handling
  • Error handling
  • Comparer customization
  • Related pages

Was this helpful?

Export as PDF
  1. Binders

Collections

PreviousPrimitivesNextClasses and structs

Last updated 4 years ago

Was this helpful?

Supported types

Arrays and lists:

  • T[]

  • List<T>

  • IEnumerable<T> (backed by T[])

  • IReadOnlyList<T>(backed by T[])

  • IReadOnlyCollection<T>(backed by T[])

  • ICollection<T> (backed by List<T>)

  • IList<T>(backed by List<T>)

Dictionaries:

  • Dictionary<TKey, TValue>

  • IDictionary<TKey, TValue> (backed by Dictionary)

  • IReadOnlyDictionary<TKey, TValue> (backed by Dictionary)

Sets:

  • HashSet<T>

  • ISet<T> (backed by HashSet)

Collections can have and other collections as elements.

Binder requirements

Collections require binders defined for element types (both keys and values in case of dictionaries).

Node requirements

Null node handling

Nulls are not valid as dictionary keys.

Error handling

Any element binding failure results in complete collection binding failure.

Comparer customization

Related pages

or node. Empty nodes are converted to empty collections.

An empty collection is returned unless .

A custom element comparer (such as StringComparer.OrdinalIgnoreCase for case-insensitive dictionary keys) can be achieved by wrapping the collection in a custom type and utilizing the .

classes, structs
Array
object
explictly required
constructor binding convention
Binding nodes to models
Constructor injection