/// <summary> /// Handles completion of the underlying operation in the <see cref="DomainContext"/>. /// </summary> /// <param name="operation">The operation that completed</param> private void HandleOperationComplete(OperationBase operation) { WebAsyncResult result = ((WebAsyncResult)operation.UserState); if (operation.HasError) { operation.MarkErrorAsHandled(); } if (!operation.IsCanceled) { result.Complete(); } }
/// <summary> /// Handles completion of the underlying operation in the <see cref="DomainContext"/>. /// </summary> /// <param name="operation">The operation that completed</param> private void HandleOperationComplete(OperationBase operation) { WebAsyncResult result = ((WebAsyncResult)operation.UserState); // If the submic callback is executed before the BeginMethod has set InnerOparation // then do so here before calling Complete. // Since there is a race condition otherwise if (result.InnerOperation == null) { result.InnerOperation = operation; } if (operation.HasError) { operation.MarkErrorAsHandled(); } if (!operation.IsCanceled) { result.Complete(); } }