Ejemplo n.º 1
0
        public static T EndExecuteAsync <T>(IAsyncResult result)
        {
            CommonUtils.AssertNotNull("result", result);

            ExecutionState <T> executionState = (ExecutionState <T>)result;

            executionState.End();
            if (executionState.ExceptionRef != null)
            {
                throw executionState.ExceptionRef;
            }

            return(executionState.Result);
        }
Ejemplo n.º 2
0
        public static T EndExecuteAsync <T, INTERMEDIATE_TYPE>(IAsyncResult result)
        {
            ExecutionState <T> executionState = result as ExecutionState <T>;

            CommonUtils.AssertNotNull("result", executionState);

            executionState.End();

            TableCommand <T, INTERMEDIATE_TYPE> tableCommandRef = executionState.Cmd as TableCommand <T, INTERMEDIATE_TYPE>;

            ReleaseContext(tableCommandRef.Context);

            if (executionState.ExceptionRef != null)
            {
                throw executionState.ExceptionRef;
            }

            return(executionState.Result);
        }
        public static T EndExecuteAsync <T>(IAsyncResult result)
        {
            CommonUtility.AssertNotNull("result", result);

            using (ExecutionState <T> executionState = (ExecutionState <T>)result)
            {
                executionState.End();

                executionState.RestCMD.SendStream        = null;
                executionState.RestCMD.DestinationStream = null;

                if (executionState.ExceptionRef != null)
                {
                    throw executionState.ExceptionRef;
                }

                return(executionState.Result);
            }
        }