ASP.NET Core`Main`(`Program.cs`)Web
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup
.Build();
// host
host.Run();
}
}
`IWebHost.Run()`Web`args``Run()`
if (args[0] == "controller"
&& args[1] == "action")
{
//
}
else
{
host.Run();
}
`host.Services.GetService(Type)`Dependency Injection`Type`HTTP
var hoge = (HogeService)host.GetService(typeof(HogeService));
hoge.ExecuteFuga();
// HogeControllerHogeService`ExecuteFuga`
`args``IActionDescriptorCollectionProvider`
Web`host``ServiceCollection``Configure`DI
`Console.In`()`Console.OpenStandardInput`()