Delen via


ConsoleLifetime Constructors

Definition

Overloads

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>)

Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host application lifetime and host options.

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>, ILoggerFactory)

Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host options and logger factory.

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>)

Source:
ConsoleLifetime.cs
Source:
ConsoleLifetime.cs
Source:
ConsoleLifetime.cs
Source:
ConsoleLifetime.cs
Source:
ConsoleLifetime.cs

Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host application lifetime and host options.

public:
 ConsoleLifetime(Microsoft::Extensions::Options::IOptions<Microsoft::Extensions::Hosting::ConsoleLifetimeOptions ^> ^ options, Microsoft::Extensions::Hosting::IHostEnvironment ^ environment, Microsoft::Extensions::Hosting::IHostApplicationLifetime ^ applicationLifetime, Microsoft::Extensions::Options::IOptions<Microsoft::Extensions::Hosting::HostOptions ^> ^ hostOptions);
public ConsoleLifetime (Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> options, Microsoft.Extensions.Hosting.IHostEnvironment environment, Microsoft.Extensions.Hosting.IHostApplicationLifetime applicationLifetime, Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> hostOptions);
new Microsoft.Extensions.Hosting.Internal.ConsoleLifetime : Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> * Microsoft.Extensions.Hosting.IHostEnvironment * Microsoft.Extensions.Hosting.IHostApplicationLifetime * Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> -> Microsoft.Extensions.Hosting.Internal.ConsoleLifetime
Public Sub New (options As IOptions(Of ConsoleLifetimeOptions), environment As IHostEnvironment, applicationLifetime As IHostApplicationLifetime, hostOptions As IOptions(Of HostOptions))

Parameters

options
IOptions<ConsoleLifetimeOptions>

An object used to retrieve ConsoleLifetimeOptions instances.

environment
IHostEnvironment

An object that contains information about the hosting environment an application is running in.

applicationLifetime
IHostApplicationLifetime

An object that allows consumers to be notified of application lifetime events.

hostOptions
IOptions<HostOptions>

An object used to retrieve Microsoft.Extensions.Hosting.Internal.ConsoleLifetime.HostOptions instances.

Exceptions

options or environment or applicationLifetime or hostOptions is null.

Applies to

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>, ILoggerFactory)

Source:
ConsoleLifetime.cs
Source:
ConsoleLifetime.cs
Source:
ConsoleLifetime.cs
Source:
ConsoleLifetime.cs
Source:
ConsoleLifetime.cs

Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host options and logger factory.

public:
 ConsoleLifetime(Microsoft::Extensions::Options::IOptions<Microsoft::Extensions::Hosting::ConsoleLifetimeOptions ^> ^ options, Microsoft::Extensions::Hosting::IHostEnvironment ^ environment, Microsoft::Extensions::Hosting::IHostApplicationLifetime ^ applicationLifetime, Microsoft::Extensions::Options::IOptions<Microsoft::Extensions::Hosting::HostOptions ^> ^ hostOptions, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory);
public ConsoleLifetime (Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> options, Microsoft.Extensions.Hosting.IHostEnvironment environment, Microsoft.Extensions.Hosting.IHostApplicationLifetime applicationLifetime, Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> hostOptions, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
new Microsoft.Extensions.Hosting.Internal.ConsoleLifetime : Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> * Microsoft.Extensions.Hosting.IHostEnvironment * Microsoft.Extensions.Hosting.IHostApplicationLifetime * Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.Extensions.Hosting.Internal.ConsoleLifetime
Public Sub New (options As IOptions(Of ConsoleLifetimeOptions), environment As IHostEnvironment, applicationLifetime As IHostApplicationLifetime, hostOptions As IOptions(Of HostOptions), loggerFactory As ILoggerFactory)

Parameters

options
IOptions<ConsoleLifetimeOptions>

An object used to retrieve ConsoleLifetimeOptions instances

environment
IHostEnvironment

An object that contains information about the hosting environment an application is running in.

applicationLifetime
IHostApplicationLifetime

An object that allows consumers to be notified of application lifetime events.

hostOptions
IOptions<HostOptions>

An object used to retrieve Microsoft.Extensions.Hosting.Internal.ConsoleLifetime.HostOptions instances.

loggerFactory
ILoggerFactory

An object to configure the logging system and create instances of ILogger from the registered ILoggerProvider.

Exceptions

options or environment or applicationLifetime or hostOptions or loggerFactory is null.

Applies to