示例#1
0
        public string ServiceCall(bool throwException)
        {
            ServiceParameterPassed            startMessage = new ServiceParameterPassed(throwException);
            MessageGateResult <ServiceResult> result       = gate.SendAndAwait(startMessage, OnMessage);

            return(result.Result == MessageGateResultKind.Success ? result.EndMessage.Result : "Exception");
        }
        protected override InterceptionAction InterceptCore(Message messageData)
        {
            ServiceParameterPassed parameterPassed = messageData.Get <ServiceParameterPassed>();

            if (parameterPassed.ThrowException)
            {
                OnMessage(new ExceptionMessage("Error", messageData, this));
                return(InterceptionAction.DoNotPublish);
            }

            return(InterceptionAction.Continue);
        }