internal static TResult EndOperationHelper <TResult>(IServiceClient serviceClient, IAsyncResult asyncResult)
        {
            var response = EndOperationHelper(serviceClient, asyncResult);

            using (RetryableAsyncResult retryableAsyncResult = asyncResult as RetryableAsyncResult)
            {
                Debug.Assert(retryableAsyncResult != null);
                OssCommand <TResult> cmd = (OssCommand <TResult>)retryableAsyncResult.Context.Command;
                return(cmd.DeserializeResponse(response));
            }
        }
Beispiel #2
0
        internal static TResult EndOperationHelper <TResult>(IServiceClient serviceClient, IAsyncResult asyncResult)
        {
            var response = EndOperationHelper(serviceClient, asyncResult);
            RetryableAsyncResult retryableAsyncResult = asyncResult as RetryableAsyncResult;

            if (retryableAsyncResult == null)
            {
                retryableAsyncResult = asyncResult.AsyncState as RetryableAsyncResult;
            }

            if (retryableAsyncResult != null)
            {
                using (retryableAsyncResult)
                {
                    Debug.Assert(retryableAsyncResult != null);
                    OssCommand <TResult> cmd = (OssCommand <TResult>)retryableAsyncResult.Context.Command;
                    return(cmd.DeserializeResponse(response));
                }
            }
            else
            {
                throw new ArgumentException("asyncResult");
            }
        }