RazorDocs Search

Defaults

Type

NoHostModule

A basic implementation of IRunnableHostModule that does nothing. This is useful for providing implementations of apps that do not require a module.

Method

ConfigureServices

void ConfigureServices(StartupContext context, IServiceCollection services)

Configures services for the module. This implementation is empty.

Parameters

  • contextThe startup context.
  • servicesThe service collection.
Method

RegisterDependentModules

void RegisterDependentModules(ModuleDependencyBuilder builder)

Registers dependent modules. This implementation is empty.

Parameters

  • builderThe module dependency builder.
Method

ConfigureHostBeforeServices

void ConfigureHostBeforeServices(StartupContext context, IHostBuilder builder)

Configures the host before services are registered. This implementation is empty.

Parameters

  • contextThe startup context.
  • builderThe host builder.
Method

ConfigureHostAfterServices

void ConfigureHostAfterServices(StartupContext context, IHostBuilder builder)

Configures the host after services are registered. This implementation is empty.

Parameters

  • contextThe startup context.
  • builderThe host builder.
Type

DefaultEnvironmentProvider

Default implementation of IEnvironmentProvider that retrieves the environment from system environment variables. It checks for "ASPNETCORE_ENVIRONMENT" first, then "DOTNET_ENVIRONMENT", and defaults to "Production" if neither is set. Can be overridden by passing a custom implementation to the StartupContext, when building the host.

Method

GetEnvironmentVariable

string? GetEnvironmentVariable(string name, string? defaultValue = null)

Gets the value of an environment variable from the system.

Parameters

  • nameThe name of the environment variable.
  • defaultValueThe default value to return if the environment variable is null or empty.

Returns

The environment variable value or the provided default if the variable is null or empty.

Property

Environment

string Environment { get; }

The current environment name. Read from "ASPNETCORE_ENVIRONMENT" or "DOTNET_ENVIRONMENT" environment variables, defaults to "Production" if neither is set.

Property

IsDevelopment

bool IsDevelopment { get; }

True if the current environment is "Development".

Type

InternalServicesModule

Internal Services Registration