protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); var container = InstanceFactory.RegisterModules(Register.RegisterWebApi); var resolve = new SimpleInjectorDependencyResolver(container); DependencyResolver.SetResolver(resolve); }
public static void Initialize() { _container = new Container(); _container.Options.DefaultScopedLifestyle = new WebRequestLifestyle(); InitializeContainer(_container); _container.RegisterMvcControllers(Assembly.GetExecutingAssembly()); _container.RegisterMvcIntegratedFilterProvider(); var dependencyResolver = new SimpleInjectorDependencyResolver(_container); DependencyResolver.SetResolver(dependencyResolver); DomainEvent.Container = new DomainEventContainer(dependencyResolver); _container.Verify(); }