void Application_Start(object sender, EventArgs e) { // Code that runs on application startup var assemblies = BuildManager.GetReferencedAssemblies().Cast <Assembly>().ToArray(); webapp = new WebApp(); // setup up dependency injection container var wcc = webapp.GetConfiguration(); wcc.Context.EnablePropertyInjection(); wcc.RegisterAllTypes(); // setup web dependency injection webapp.Bootstrap(assemblies); if (Configuration.Current.Production) { Application["AppServer"] = $"http://{Environment.MachineName}.eecs.umich.edu/"; } else { Application["AppServer"] = "/"; } }
public void Init(HttpApplication app) { Assembly[] assemblies = BuildManager.GetReferencedAssemblies().Cast <Assembly>().ToArray(); var webapp = new WebApp(); webapp.Context.EnablePropertyInjection(); var wcc = webapp.GetConfiguration(); wcc.RegisterAllTypes(); RegisterTypes(webapp.Context); webapp.BootstrapMvc(assemblies); _provider = webapp.Context.GetInstance <IProvider>(); app.BeginRequest += App_BeginRequest; app.EndRequest += App_EndRequest; }