Skip to content

Environment variables

Adam Bajguz edited this page Apr 5, 2021 · 7 revisions

To maintain testability and immutability of environment variables values while the application is running, Typin uses a special service IEnvironmentVariablesAccessor that can be used to access environment variables passed to CliApplication.RunAsync or read from the environment with Environment.GetEnvironmentVariables().

By default IEnvironmentVariablesAccessor is used in EnvironmentVariableFallbackProvider to provide an option fallback values when needed.

IEnvironmentVariablesAccessor is registered in DI container as singleton, and can be safely injected into any service.

Clone this wiki locally