public void Configuration(IAppBuilder app) { AppInitializer.Initalize(new AppServicesInit()); app.UseCors(CorsOptions.AllowAll); ConfigureOAuth(app); ConfigureWebApi(app); }
private void Application_Startup(object sender, StartupEventArgs e) { AppInitializer.Initalize(new WpfAppInit()); LoginView vwLogin = DI.DefaultServiceProvider.GetService <LoginView>(); NameValueCollection parameters = new NameValueCollection(); parameters.Add(ViewParams.Mode.Param, ViewParams.Mode.Popup); ViewModel.NavigateTo(DI.DefaultServiceProvider.GetService <LoginViewModel>(), vwLogin, parameters, null, null); }
/// <summary> /// Constructs a new DefaultServiceProviderHostFactory and ensures the app is initialized /// </summary> public DefaultServiceProviderHostFactory() { if (DI.DefaultServiceProvider != null) { return; } const string CfgAppInit = "xomfwk:AppInitializer"; Type initType = AppInitializer.GetType(ConfigurationManager.AppSettings[CfgAppInit]); if (initType == null) { throw new ApplicationException("Cannot instantiate DI application initializer. Make sure you set the " + CfgAppInit + " config to a subclass of the AppInitalizer with a default constructor."); } AppInitializer.Initalize(Activator.CreateInstance(initType) as AppInitializer); }
public void Configuration(IAppBuilder app) { AppInitializer.Initalize(new WebAppInit()); app.Use <DIMiddleware>(); ConfigureAuth(app); }