From 45649980917a6ba3fda1965dcccab08a35b23f4c Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Sat, 11 May 2019 11:51:33 -0500 Subject: [PATCH] Call out special builder method names (#12384) --- aspnetcore/fundamentals/host/web-host.md | 6 ++++-- aspnetcore/fundamentals/index.md | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/aspnetcore/fundamentals/host/web-host.md b/aspnetcore/fundamentals/host/web-host.md index 04a2a7c8d0..f7d3831f78 100644 --- a/aspnetcore/fundamentals/host/web-host.md +++ b/aspnetcore/fundamentals/host/web-host.md @@ -4,7 +4,7 @@ author: guardrex description: Learn about Web Host in ASP.NET Core, which is responsible for app startup and lifetime management. ms.author: riande ms.custom: mvc -ms.date: 12/18/2018 +ms.date: 05/11/2019 uid: fundamentals/host/web-host --- # ASP.NET Core Web Host @@ -33,7 +33,9 @@ This article covers the ASP.NET Core Web Host ([IWebHostBuilder](/dotnet/api/mic ## Set up a host -Create a host using an instance of [IWebHostBuilder](/dotnet/api/microsoft.aspnetcore.hosting.iwebhostbuilder). This is typically performed in the app's entry point, the `Main` method. In the project templates, `Main` is located in *Program.cs*. A typical *Program.cs* calls [CreateDefaultBuilder](/dotnet/api/microsoft.aspnetcore.webhost.createdefaultbuilder) to start setting up a host: +Create a host using an instance of [IWebHostBuilder](/dotnet/api/microsoft.aspnetcore.hosting.iwebhostbuilder). This is typically performed in the app's entry point, the `Main` method. The builder method name, `CreateWebHostBuilder`, is special name that identifies the builder method to external components, such as [Entity Framework](/ef/core/). + +In the project templates, `Main` is located in *Program.cs*. A typical app calls [CreateDefaultBuilder](/dotnet/api/microsoft.aspnetcore.webhost.createdefaultbuilder) to start setting up a host: ```csharp public class Program diff --git a/aspnetcore/fundamentals/index.md b/aspnetcore/fundamentals/index.md index c90f3c5b54..13f5ba2492 100644 --- a/aspnetcore/fundamentals/index.md +++ b/aspnetcore/fundamentals/index.md @@ -5,7 +5,7 @@ description: Learn the foundational concepts for building ASP.NET Core apps. monikerRange: '>= aspnetcore-2.1' ms.author: riande ms.custom: mvc -ms.date: 03/31/2019 +ms.date: 05/11/2019 uid: fundamentals/index --- # ASP.NET Core fundamentals @@ -72,6 +72,8 @@ The code to create a host is in `Program.Main` and follows the [builder pattern] ::: moniker range=">= aspnetcore-3.0" +`CreateHostBuilder` is special name that identifies the builder method to external components, such as [Entity Framework](/ef/core/). + In ASP.NET Core 3.0 or later, Generic Host (`Host` class) or Web Host (`WebHost` class) can be used in a web app. Generic Host is recommended, and Web Host is available for backwards compatibility. The framework provides the `CreateDefaultBuilder` and `ConfigureWebHostDefaults` methods to set up a host with commonly used options, such as the following: @@ -90,6 +92,8 @@ For more information, see and