Skip to content

Commit 21bc231

Browse files
define Generic host (#17849)
* define Generic host * define Generic host * define Generic host
1 parent e8c4461 commit 21bc231

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

aspnetcore/fundamentals/host/generic-host.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ uid: fundamentals/host/generic-host
1212

1313
::: moniker range=">= aspnetcore-3.0 <= aspnetcore-3.1"
1414

15-
The ASP.NET Core templates create a .NET Core Generic Host (<xref:Microsoft.Extensions.Hosting.HostBuilder>).
15+
The ASP.NET Core templates create a .NET Core Generic Host, <xref:Microsoft.Extensions.Hosting.HostBuilder>.
1616

1717
## Host definition
1818

@@ -34,7 +34,7 @@ The host is typically configured, built, and run by code in the `Program` class.
3434
* Calls a `CreateHostBuilder` method to create and configure a builder object.
3535
* Calls `Build` and `Run` methods on the builder object.
3636

37-
The ASP.NET Core web templates generate the following code to create a host:
37+
The ASP.NET Core web templates generate the following code to create a Generic Host:
3838

3939
```csharp
4040
public class Program
@@ -53,7 +53,7 @@ public class Program
5353
}
5454
```
5555

56-
The following code creates a non-HTTP workload with a `IHostedService` implementation added to the DI container.
56+
The following code creates a Generic Host using non-HTTP workload. The `IHostedService` implementation is added to the DI container:
5757

5858
```csharp
5959
public class Program
@@ -83,6 +83,8 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
8383
});
8484
```
8585

86+
The preceding code is generated by the ASP.NET Core templates.
87+
8688
If the app uses Entity Framework Core, don't change the name or signature of the `CreateHostBuilder` method. The [Entity Framework Core tools](/ef/core/miscellaneous/cli/) expect to find a `CreateHostBuilder` method that configures the host without running the app. For more information, see [Design-time DbContext Creation](/ef/core/miscellaneous/cli/dbcontext-creation).
8789

8890
## Default builder settings

0 commit comments

Comments
 (0)