关于[ .NET Core Opinion 12 – Use Your ASP.NET Core App as an Executable]的摘要:
There is a special moment of time in the life of every ASP.NET Core process when the application has all the services registered and all the configuration sources in place, but has not yet started to listen for HTTP messages. This is a moment in time you can seize and use to your advantage. I tell people to think of their ASP.NET Core application as a console application that happens to listen for network connections, because there are many useful tasks the application can perform at development time and in production. Examples would be tasks like migrating database schemas, clearing a distributed cache, and creating storage containers.
原文地址: https://odetocode.com/blogs/scott/archive/2019/03/27/net-core-opinion-12-use-your-asp-net-core.aspx