Пример #1
0
        protected void Application_Start()
        {
            AppSetupBuilderAttribute builder = this.GetType().GetCustomAttribute <AppSetupBuilderAttribute>();

            if (builder == null)
            {
                builder = new AppSetupBuilderAttribute();
            }
            this.AppSetupBuilderPrepared?.Invoke(this, new OnAppSetupBuilderPreparedEventArgs(builder));

            AppSetup appSetup = builder.Build();

            appSetup.AppContext[Constant.APP_CONTEXT_KEY_ENV] = Constant.ENV_WEBAPI;

            TAppModule webAppModule = new TAppModule();

            this.AppSetupPrepared?.Invoke(this, new OnAppSetupPreparedEventArgs(appSetup));
            var app = appSetup.Start(webAppModule);

            this.AppStarted?.Invoke(this, new OnAppStartedEventArgs(app));
            this.Application.Set(Constant.APPLICATION_ITEM_KEY, app);
        }
Пример #2
0
 public AppModulePrepareArguments(AppSetup appSetup)
 {
     AppSetup = appSetup;
 }
Пример #3
0
 public static App Start <TAppModule>()
     where TAppModule : IAppModule, new()
 {
     return(AppSetup.Start <TAppModule>(new AppSetupOptions()));
 }