protected override Application_Start() { var container = new Container(); container.RegisterMvcControllers(); BusinessLayerBootstrapper.Bootstrap(container, new WebRequestLifestyle()); DependencyResolver.SetResolver( new SimpleInjectorDependencyResolver(container)); }
public static Container Bootstrap(Container container) { BusinessLayerBootstrapper.Bootstrap(container); container.RegisterSingleton <IPrincipal, HttpContextPrincipal>(); container.RegisterInstance <ILogger>(new DebugLogger()); return(container); }
public static Container Bootstrap(Container container, IApplicationBuilder app) { container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle(); BusinessLayerBootstrapper.Bootstrap(container); container.RegisterSingleton <IPrincipal, HttpContextPrincipal>(); container.RegisterInstance <ILogger>(new DebugLogger()); container.Verify(); return(container); }
public static Container Bootstrap() { var container = new Container(); container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle(); BusinessLayerBootstrapper.Bootstrap(container); container.RegisterInstance <IPrincipal>(new HttpContextPrincipal()); container.RegisterInstance <ILogger>(new DebugLogger()); return(container); }
public static void Bootstrap() { // Did you know the container can diagnose your configuration? Go to: http://bit.ly/YE8OJj. container = new Container(); BusinessLayerBootstrapper.Bootstrap(container); container.RegisterDecorator(typeof(ICommandHandler <>), typeof(ToWcfFaultTranslatorCommandHandlerDecorator <>)); container.RegisterWcfServices(Assembly.GetExecutingAssembly()); RegisterWcfSpecificDependencies(); container.Verify(); }
public static void Bootstrap() { container = new Container(); BusinessLayerBootstrapper.Bootstrap(container); container.RegisterDecorator(typeof(ICommandHandler <>), typeof(ToWcfFaultTranslatorCommandHandlerDecorator <>)); container.RegisterWcfServices(Assembly.GetExecutingAssembly()); RegisterWcfSpecificDependencies(); container.Verify(); }
public static Container Bootstrap() { var container = new Container(); container.Options.DefaultScopedLifestyle = new WebApiRequestLifestyle(); BusinessLayerBootstrapper.Bootstrap(container); container.RegisterSingleton <IPrincipal>(new HttpContextPrincipal()); container.RegisterSingleton <ILogger>(new DebugLogger()); container.Verify(); return(container); }
public static void Bootstrap() { // Did you know the container can diagnose your configuration? Go to: https://bit.ly/YE8OJj. var container = new Container(); container.Options.DefaultScopedLifestyle = new WebRequestLifestyle(); BusinessLayerBootstrapper.Bootstrap(container); RegisterWebApiSpecificDependencies(container); container.RegisterMvcControllers(Assembly.GetExecutingAssembly()); container.RegisterMvcIntegratedFilterProvider(); container.Verify(); GlobalConfiguration.Configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container); System.Web.Mvc.DependencyResolver.SetResolver( new SimpleInjector.Integration.Web.Mvc.SimpleInjectorDependencyResolver(container)); }