예제 #1
0
        public virtual IEnumerable <TOut> Execute <TIn, TOut>(TIn request) where TIn : SimpleServiceRequestBase where TOut : ServiceResponse
        {
            Recorder.Trace(5L, TraceType.InfoTrace, "ExchangeProxy.Execute Request:", request);
            MultiResponseServiceRequest <TOut> multiResponseServiceRequest = request as MultiResponseServiceRequest <TOut>;

            if (multiResponseServiceRequest != null)
            {
                return(multiResponseServiceRequest.Execute());
            }
            return(new TOut[]
            {
                request.InternalExecute() as TOut
            });
        }
예제 #2
0
        public virtual IEnumerable <TOut> EndExecute <TIn, TOut>(IAsyncResult result) where TIn : SimpleServiceRequestBase where TOut : ServiceResponse
        {
            Recorder.Trace(5L, TraceType.InfoTrace, "ExchangeProxy.EndExecute Result:", result);
            TIn tin = AsyncRequestResult.ExtractServiceRequest <TIn>(this.ExchangeService, result);
            MultiResponseServiceRequest <TOut> multiResponseServiceRequest = tin as MultiResponseServiceRequest <TOut>;

            if (multiResponseServiceRequest != null)
            {
                return(multiResponseServiceRequest.EndExecute(result));
            }
            return(new TOut[]
            {
                tin.EndInternalExecute(result) as TOut
            });
        }