Esempio n. 1
0
        public ExceptionShieldingAttribute(string exceptionPolicyName)
        {
            this.exceptionPolicyName = exceptionPolicyName;
            ExceptionShieldingBehavior behavior = new ExceptionShieldingBehavior(exceptionPolicyName);

            this.contractBehavior = (IContractBehavior)behavior;
            this.serviceBehavior  = (IServiceBehavior)behavior;
            this.errorHandler     = new ExceptionShieldingErrorHandler(exceptionPolicyName);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ExceptionShieldingAttribute"/> class.
        /// </summary>
        /// <param name="exceptionPolicyName">Name of the exception policy.</param>
        public ExceptionShieldingAttribute(string exceptionPolicyName)
        {
            this.exceptionPolicyName = exceptionPolicyName;
            
            //The ServiceHost applies behaviors in the following order:
            // Contract
            // Operation
            // Endpoint
            // Service

            ExceptionShieldingBehavior behavior = new ExceptionShieldingBehavior(exceptionPolicyName);
            this.contractBehavior = (IContractBehavior)behavior;
            this.serviceBehavior = (IServiceBehavior)behavior;
            this.errorHandler = new ExceptionShieldingErrorHandler(exceptionPolicyName);
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ExceptionShieldingAttribute"/> class.
        /// </summary>
        /// <param name="exceptionPolicyName">Name of the exception policy.</param>
        public ExceptionShieldingAttribute(string exceptionPolicyName)
        {
            this.exceptionPolicyName = exceptionPolicyName;

            //The ServiceHost applies behaviors in the following order:
            // Contract
            // Operation
            // Endpoint
            // Service

            ExceptionShieldingBehavior behavior = new ExceptionShieldingBehavior(exceptionPolicyName);

            this.contractBehavior = (IContractBehavior)behavior;
            this.serviceBehavior  = (IServiceBehavior)behavior;
            this.errorHandler     = new ExceptionShieldingErrorHandler(exceptionPolicyName);
        }