Partilhar via


HostingHostBuilderExtensions.UseConsoleLifetime Método

Definição

Sobrecargas

UseConsoleLifetime(IHostBuilder)

Escuta o Ctrl+C ou o SIGTERM e chama StopApplication() para iniciar o processo de desligamento. Isso desbloqueará extensões como RunAsync e WaitForShutdownAsync.

UseConsoleLifetime(IHostBuilder, Action<ConsoleLifetimeOptions>)

Escuta o Ctrl+C ou o SIGTERM e chama StopApplication() para iniciar o processo de desligamento. Isso desbloqueará extensões como RunAsync e WaitForShutdownAsync.

UseConsoleLifetime(IHostBuilder)

Origem:
HostingHostBuilderExtensions.cs
Origem:
HostingHostBuilderExtensions.cs
Origem:
HostingHostBuilderExtensions.cs

Escuta o Ctrl+C ou o SIGTERM e chama StopApplication() para iniciar o processo de desligamento. Isso desbloqueará extensões como RunAsync e WaitForShutdownAsync.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ UseConsoleLifetime(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder);
public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder);
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member UseConsoleLifetime : Microsoft.Extensions.Hosting.IHostBuilder -> Microsoft.Extensions.Hosting.IHostBuilder
static member UseConsoleLifetime : Microsoft.Extensions.Hosting.IHostBuilder -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function UseConsoleLifetime (hostBuilder As IHostBuilder) As IHostBuilder

Parâmetros

hostBuilder
IHostBuilder

O IHostBuilder a ser configurado.

Retornos

A mesma instância do IHostBuilder para encadeamento.

Atributos

Aplica-se a

UseConsoleLifetime(IHostBuilder, Action<ConsoleLifetimeOptions>)

Origem:
HostingHostBuilderExtensions.cs
Origem:
HostingHostBuilderExtensions.cs
Origem:
HostingHostBuilderExtensions.cs

Escuta o Ctrl+C ou o SIGTERM e chama StopApplication() para iniciar o processo de desligamento. Isso desbloqueará extensões como RunAsync e WaitForShutdownAsync.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ UseConsoleLifetime(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder, Action<Microsoft::Extensions::Hosting::ConsoleLifetimeOptions ^> ^ configureOptions);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> configureOptions);
public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> configureOptions);
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member UseConsoleLifetime : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> -> Microsoft.Extensions.Hosting.IHostBuilder
static member UseConsoleLifetime : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function UseConsoleLifetime (hostBuilder As IHostBuilder, configureOptions As Action(Of ConsoleLifetimeOptions)) As IHostBuilder

Parâmetros

hostBuilder
IHostBuilder

O IHostBuilder a ser configurado.

configureOptions
Action<ConsoleLifetimeOptions>

O delegado para configurar o ConsoleLifetime.

Retornos

A mesma instância do IHostBuilder para encadeamento.

Atributos

Aplica-se a