public Action <IApplicationBuilder> Configure(Action <IApplicationBuilder> next) { return(app => { _runner.Configure(app, _configuration, _hostingEnvironment); _runner.RunApplicationInitializers(app.ApplicationServices).GetAwaiter().GetResult(); next(app); }); }
public async Task RunsApplicationInitializers() { // Arrange var options = new StartupModulesOptions(); options.ApplicationInitializers.Add(typeof(MyAppInitializer)); var runner = new StartupModuleRunner(options); // Act await runner.RunApplicationInitializers(new ServiceCollection().BuildServiceProvider()); // Assert // wat do ¯\_(ツ)_/¯ }