Skip to content

Commit 27ba52d

Browse files
authored
Merge pull request #90 from pmorong/patch-1
Update README to show new configuration pattern [skip ci]
2 parents ce31a0d + 316f7e1 commit 27ba52d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class Program
2929
try
3030
{
3131
Log.Information("Starting web host");
32-
BuildWebHost(args).Run();
32+
CreateWebHostBuilder(args).Build().Run();
3333
return 0;
3434
}
3535
catch (Exception ex)
@@ -46,12 +46,11 @@ public class Program
4646

4747
**Then**, add `UseSerilog()` to the web host builder in `BuildWebHost()`.
4848

49-
```csharp
50-
public static IWebHost BuildWebHost(string[] args) =>
51-
WebHost.CreateDefaultBuilder(args)
52-
.UseStartup<Startup>()
53-
.UseSerilog() // <-- Add this line
54-
.Build();
49+
```csharp
50+
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
51+
WebHost.CreateDefaultBuilder(args)
52+
.UseStartup<Startup>()
53+
.UseSerilog(); // <-- Add this line;
5554
}
5655
```
5756

0 commit comments

Comments
 (0)