예제 #1
0
        public void Intercept(IInvocation invocation)
        {
            if (!_isIntercepting)
            {
                return;
            }
            var mappedInvocation = _invocationMapper.Map(invocation);

            invocation.ReturnValue = _callRouter.Route(mappedInvocation);
        }
예제 #2
0
        public void Intercept(IInvocation invocation)
        {
            var mappedInvocation = _invocationMapper.Map(invocation);

            if (_fullDispatchMode)
            {
                invocation.ReturnValue = _callRouter.Route(mappedInvocation);
                return;
            }

            // Fallback to the base value until the full dispatch mode is activated.
            // Useful to ensure that object is initialized properly.
            if (_callRouter.CallBaseByDefault)
            {
                invocation.ReturnValue = mappedInvocation.TryCallBase().ValueOrDefault();
            }
        }