private void Initialize(IUnityContainer container)
        {
            if (container.Configure <Interception>() == null)
            {
                throw new ArgumentException("Container does not have the interception extension", "container");
            }

            if (container.Configure <TransientPolicyBuildUpExtension>() == null)
            {
                throw new ArgumentException("Container does not have the transient buildup extension", "container");
            }

            this.container = container;

            this.instanceInterceptionPolicySettingInjectionMember =
                new InstanceInterceptionPolicySettingInjectionMember(new TransparentProxyInterceptor());
        }
Exemple #2
0
        private void Initialize(IServiceLocator providedServiceLocator)
        {
            this.serviceLocator = providedServiceLocator;
            try
            {
                this.container = providedServiceLocator.GetInstance <IUnityContainer>();
            }
            catch (ActivationException e)
            {
                throw new InvalidOperationException("Cannot resolve container", e);
            }

            if (this.container.Configure <Interception>() == null)
            {
                throw new InvalidOperationException("Container does not have the interception extension");
            }

            this.instanceInterceptionPolicySettingInjectionMember =
                new InstanceInterceptionPolicySettingInjectionMember(new TransparentProxyInterceptor());
        }