Table of Contents

Class ApplicationStartup

Namespace
Tlabs
Assembly
Tlabs.Core.dll

Class to facillitate the creation of the application's start-up configuration expressed as a pre-configured IHostBuilder.

public sealed class ApplicationStartup
Inheritance
ApplicationStartup
Inherited Members
Extension Methods

Remarks

The ambition of this ApplicationStartup class is to reducee hard-coded pre-configuration to an absolute minimum with favor of leveraging the IConfigurator<T> base ApplyConfigurator(...) pattern.

Constructors

ApplicationStartup()

public ApplicationStartup()

Fields

APP_ENV_VAR

Environment variable to control loading of an additional settings file with the naming pattern:

appsettings.{%APP_ENV_VAR%}.json
.
public const string APP_ENV_VAR = "ASPNETCORE_ENVIRONMENT"

Field Value

string

Examples

appsettings.Development.json appsettings.Azure.json

APP_SVC_SECTION

Application services config section.

public const string APP_SVC_SECTION = "applicationServices"

Field Value

string

DFLT_HOST_SECTION

Default section of the configuratiion to be used for the start-up hosting environment setup.

public const string DFLT_HOST_SECTION = "appHosting"

Field Value

string

Methods

CreateAppHostBuilder(string, string[]?, Action<IHostBuilder, IConfiguration>?)

Create a IHostBuilder from hostSection and command line args.

public static IHostBuilder CreateAppHostBuilder(string hostSection, string[]? args = null, Action<IHostBuilder, IConfiguration>? cfgBuilder = null)

Parameters

hostSection string
args string[]
cfgBuilder Action<IHostBuilder, IConfiguration>

Returns

IHostBuilder

CreateAppHostBuilder(string[]?, Action<IHostBuilder, IConfiguration>?)

Create a IHostBuilder from optional command line args.

public static IHostBuilder CreateAppHostBuilder(string[]? args = null, Action<IHostBuilder, IConfiguration>? cfgBuilder = null)

Parameters

args string[]
cfgBuilder Action<IHostBuilder, IConfiguration>

Returns

IHostBuilder

CreateLogFactory(IConfigurationSection)

Create a ILoggerFactory from config section logConfig

public static ILoggerFactory CreateLogFactory(IConfigurationSection logConfig)

Parameters

logConfig IConfigurationSection

Returns

ILoggerFactory

InitLog<T>(Assembly?)

Creates an application logger (and intital log output).

public static ILogger<T> InitLog<T>(Assembly? entryAsm = null)

Parameters

entryAsm Assembly

Entry assembly

Returns

ILogger<T>

Type Parameters

T

Application type