startup

Application startup code in ASP.NET Core

扶醉桌前 提交于 2020-12-02 00:16:31
问题 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

Application startup code in ASP.NET Core

时光毁灭记忆、已成空白 提交于 2020-12-02 00:15:59
问题 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

Application startup code in ASP.NET Core

£可爱£侵袭症+ 提交于 2020-12-02 00:15:39
问题 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

Application startup code in ASP.NET Core

我怕爱的太早我们不能终老 提交于 2020-12-02 00:14:58
问题 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