From ad07741016dbd810411f7ae63935af3548d53b98 Mon Sep 17 00:00:00 2001 From: Yoshifumi Kawai <46207+neuecc@users.noreply.github.com> Date: Wed, 12 Jun 2024 13:05:09 +0900 Subject: [PATCH] Update ReadMe.md --- ReadMe.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 7c36e04..c08a637 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -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 logger) => logger.LogInformation("Hello World!")); @@ -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; ```