AspNet 3.0 Startup and Configuration:
1, Host, IHost generic host,
The official document: https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/host/generic-host?view=aspnetcore-3.0
2, IHostBuilder builder:
Primary knowledge: the interface method parameter, many have adopted Lamada function, => is a sign, the target parameter function is probably to be configured, and returned as the entire application system settings.
Method ConfigureHostConfiguration () configure the host:
configHost => {
configHost.SetBasePath(Directory.GetCurrentDirectory());
configHost.AddJsonFile("hostsettings.json", optional: true);
configHost.AddEnvironmentVariables(prefix: "PREFIX_");
configHost.AddCommandLine(args);
}
Method ConfigureAppConfiguration () configuration application: