示例#1
0
        public static T EndExecuteAsync <T, INTERMEDIATE_TYPE>(IAsyncResult result)
        {
            ExecutionState <T> executionState = result as ExecutionState <T>;

            CommonUtility.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);
        }
示例#2
0
        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);
            }
        }