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.Listens for Ctrl+C or SIGTERM and calls StopApplication() to start the shutdown process. Isso desbloqueará extensões como RunAsync e WaitForShutdownAsync.This will unblock extensions like RunAsync and WaitForShutdownAsync. |
| UseConsoleLifetime(IHostBuilder, Action<ConsoleLifetimeOptions>) |
Escuta o Ctrl+C ou o SIGTERM e chama StopApplication() para iniciar o processo de desligamento.Listens for Ctrl+C or SIGTERM and calls StopApplication() to start the shutdown process. Isso desbloqueará extensões como RunAsync e WaitForShutdownAsync.This will unblock extensions like RunAsync and WaitForShutdownAsync. |
UseConsoleLifetime(IHostBuilder)
Escuta o Ctrl+C ou o SIGTERM e chama StopApplication() para iniciar o processo de desligamento.Listens for Ctrl+C or SIGTERM and calls StopApplication() to start the shutdown process. Isso desbloqueará extensões como RunAsync e WaitForShutdownAsync.This will unblock extensions like RunAsync and WaitForShutdownAsync.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Hosting::IHostBuilder ^ UseConsoleLifetime(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder);
public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder);
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.The IHostBuilder to configure.
Retornos
A mesma instância do IHostBuilder para encadeamento.The same instance of the IHostBuilder for chaining.
Aplica-se a
UseConsoleLifetime(IHostBuilder, Action<ConsoleLifetimeOptions>)
Escuta o Ctrl+C ou o SIGTERM e chama StopApplication() para iniciar o processo de desligamento.Listens for Ctrl+C or SIGTERM and calls StopApplication() to start the shutdown process. Isso desbloqueará extensões como RunAsync e WaitForShutdownAsync.This will unblock extensions like RunAsync and WaitForShutdownAsync.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Hosting::IHostBuilder ^ UseConsoleLifetime(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);
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.The IHostBuilder to configure.
- configureOptions
- Action<ConsoleLifetimeOptions>
O delegado para configurar o Microsoft.Extensions.Hosting.Internal.ConsoleLifetime.The delegate for configuring the Microsoft.Extensions.Hosting.Internal.ConsoleLifetime.
Retornos
A mesma instância do IHostBuilder para encadeamento.The same instance of the IHostBuilder for chaining.