Exemplo n.º 1
0
        /// <summary>Integrates Unity when the application starts.</summary>
        public static void Start()
        {
            _container = IoCConfig.GetConfiguredContainer();
            var resolver = new HierarchicalDependencyResolver(_container);

            GlobalConfiguration.Configuration.DependencyResolver = resolver;
        }
Exemplo n.º 2
0
        /// <summary>Integrates Autofac when the application starts.</summary>
        public static void Start()
        {
            _container = IoCConfig.GetMvcConfiguredContainer();

            FilterProviders.Providers.Remove(FilterProviders.Providers.OfType <FilterAttributeFilterProvider>().First());
            FilterProviders.Providers.Add(new AutofacFilterProvider());

            DependencyResolver.SetResolver(new AutofacDependencyResolver(_container.GetAutofacContainer()));
        }