Пример #1
0
        public static void RegisterComponents()
        {
            var container = UnityConfigContainer.Register();
            var resolver = new UnityDependencyResolver(container);

            DomainEvents.Container = new DomainEventsContainer(resolver);

            DependencyResolver.SetResolver(resolver);
        }
 public DomainEventsContainer(UnityDependencyResolver resolver)
 {
     _resolver = resolver;
 }
 public System.Web.Mvc.IDependencyResolver CreateMvcResolver()
 {
     var resolver = new UnityDependencyResolver(_container);
     _container.RegisterInstance<System.Web.Mvc.IDependencyResolver>(resolver);
     return resolver;
 }
Пример #4
0
 public void Init(HttpApplication context)
 {
     context.EndRequest += (sender, e) => UnityDependencyResolver.DisposeOfChildContainer();
 }