Skip to content

Commit

Permalink
Update ReadMe.md
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc authored Jun 12, 2024
1 parent d9cfe26 commit ad07741
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ If you have other applications such as ASP.NET in the entire project and want to
// Package Import: Microsoft.Extensions.Hosting
var builder = Host.CreateApplicationBuilder(); // don't pass args.
using var host = builder.Build(); // using
using var host = builder.Build(); // use using for host lifetime
ConsoleApp.ServiceProvider = host.Services; // use host ServiceProvider
ConsoleApp.Run(args, ([FromServices] ILogger<Program> logger) => logger.LogInformation("Hello World!"));
Expand Down Expand Up @@ -986,7 +986,7 @@ v4 -> v5 Migration Guide
v4 was running on top of `Microsoft.Extensions.Hosting`, so build a Host in the same way and set up a ServiceProvider.

```csharp
using var host = Host.CreateDefaultBuilder().Build();
using var host = Host.CreateDefaultBuilder().Build(); // use using for host lifetime
ConsoleApp.ServiceProvider = host.ServiceProvider;
```

Expand Down

0 comments on commit ad07741

Please sign in to comment.