Application startup code in ASP.NET Core
问题 Reading over the documentation for ASP.NET Core, there are two methods singled out for Startup: Configure and ConfigureServices. Neither of these seemed like a good place to put custom code that I would like to run at startup. Perhaps I want to add a custom field to my DB if it doesn't exist, check for a specific file, seed some data into my database, etc. Code that I want to run once, just at app start. Is there a preferred/recommended approach for going about doing this? 回答1: Basically