Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public StartupActionsStartup(IServiceProvider serviceProvider, StartupActions actions, int order)
 {
     _serviceProvider = serviceProvider;
     _actions         = actions;
     Order            = order;
 }