Runtime
This layer serves as foundation and provides common libraries for an application. Baked uses .NET's standard libraries for providing an environment based configuration mechanism, dependency injection container for inversion of control and logging mechanism for monitoring and diagnostic purposes.
app.Layers.AddRuntime();
Configuration Targets
Runtime
layer provides IConfigurationBuilder
, ILoggingBuilder
,
IServiceCollection
and IServiceProvider
as configuration targets.
IConfigurationBuilder
This target is provided in BuildConfiguration
phase. To configure it in a
feature;
configurator.ConfigureConfigurationBuilder(configuration =>
{
...
});
ILoggingBuilder
This target is provided in AddServices
phase. To configure it in a feature;
configurator.ConfigureLoggingBuilder(logging =>
{
...
});
IServiceCollection
This target is provided in AddServices
phase. To configure it in a feature;
configurator.ConfigureServiceCollection(services =>
{
...
});
IServiceProvider
This target is provided in PostBuild
phase. To configure it in a feature;
configurator.ConfigureServiceProvider(sp =>
{
...
});
Phases
This layer introduces following phases to the application it is added;
BuildConfiguration
: This phase runs in the earliest stage to allow the usage ofSettings
API from featuresAddServices
: This phase creates aIServiceCollection
instance and places it in the application contextPostBuild
: This phase depends on aIServiceProvider
instance to be added to application context so that it can be provided from this layer