public SeedBuilder Configure(Action <IApplicationBuilder, IRouteBuilder, IServiceProvider> configure, int order = 0) { if (!_actions.TryGetValue(order, out var actions)) { actions = _actions[order] = new StartupActions(order); ApplicationServices.AddTransient <IStartup>(sp => new StartupActionsStartup( sp.GetRequiredService <IServiceProvider>(), actions, order)); } actions.ConfigureActions.Add(configure); return(this); }
public StartupActionsStartup(IServiceProvider serviceProvider, StartupActions actions, int order) { _serviceProvider = serviceProvider; _actions = actions; Order = order; }