Esempio n. 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);
        }
Esempio n. 2
0
 public AppModulePrepareArguments(AppSetup appSetup)
 {
     AppSetup = appSetup;
 }
 public static App Start <TAppModule>()
     where TAppModule : IAppModule, new()
 {
     return(AppSetup.Start <TAppModule>(new AppSetupOptions()));
 }