Skip to content

Commit

Permalink
Small fixes in README
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslevesque committed Feb 26, 2024
1 parent 83ceb76 commit eb4c0fa
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ A simple helper to perform async application initialization and teardown for the
4. In the `Program` class, replace the call to `host.RunAsync()` with `host.InitAndRunAsync()`:
```csharp
public static async Task Main(string[] args)
{
var host = CreateHostBuilder(args).Build();
await host.InitAndRunAsync();
}
```

This will run each initializer, in the order in which they were registered.
```csharp
public static async Task Main(string[] args)
{
var host = CreateHostBuilder(args).Build();
await host.InitAndRunAsync();
}
```
This will run each initializer, in the order in which they were registered.

## Teardown

Expand Down Expand Up @@ -153,4 +153,4 @@ await host.InitAsync();
await host.RunAsync();
```

This will still work without changes. Just keep in mind that, as explained in the previous section, adding a call to `host.TeardownAsync()` after `host.RunAsync()` *will not work*. If you need teardown, the simplest way is to remove the explicit call to `InitAsync`, and call `InitAndRunAsync` instead of `RunAsync`.
This will still work without changes. Just keep in mind that, as explained in the Advanced Usage section, adding a call to `host.TeardownAsync()` after `host.RunAsync()` *will not work*. If you need teardown, the simplest way is to remove the explicit call to `InitAsync`, and call `InitAndRunAsync` instead of `RunAsync`.

0 comments on commit eb4c0fa

Please sign in to comment.