Updating ConfigureServices overload (#9711)
Using the overload where the HostBuilderContext is available to support common usage scenarios such as accessing the environment and configuration whilst registering services.
This commit is contained in:
parent
4f330271b8
commit
b033883728
|
|
@ -16,7 +16,7 @@ namespace Company.Application1
|
||||||
|
|
||||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||||
Host.CreateDefaultBuilder(args)
|
Host.CreateDefaultBuilder(args)
|
||||||
.ConfigureServices(services =>
|
.ConfigureServices((hostContext, services) =>
|
||||||
{
|
{
|
||||||
services.AddHostedService<Worker>();
|
services.AddHostedService<Worker>();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue