private async Task CommitChangesAsync(ProcessingCommand processingCommand, bool success, IApplicationMessage message, string errorMessage, TaskCompletionSource <bool> taskSource)
        {
            if (success)
            {
                if (message != null)
                {
                    message.MergeItems(processingCommand.Message.Items);
                    await PublishMessageAsync(processingCommand, message, 0, new TaskCompletionSource <bool>()).ConfigureAwait(false);

                    taskSource.SetResult(true);
                }
                else
                {
                    await CompleteCommand(processingCommand, CommandStatus.Success, null, null).ConfigureAwait(false);

                    taskSource.SetResult(true);
                }
            }
            else
            {
                await CompleteCommand(processingCommand, CommandStatus.Failed, typeof(string).FullName, errorMessage).ConfigureAwait(false);

                taskSource.SetResult(true);
            }
        }
示例#2
0
 private void CommitChangesAsync(ProcessingCommand processingCommand, bool success, IApplicationMessage message, string errorMessage)
 {
     if (success)
     {
         if (message != null)
         {
             message.MergeItems(processingCommand.Message.Items);
             PublishMessageAsync(processingCommand, message, 0);
         }
         else
         {
             CompleteCommand(processingCommand, CommandStatus.Success, null, null);
         }
     }
     else
     {
         CompleteCommand(processingCommand, CommandStatus.Failed, typeof(string).FullName, errorMessage);
     }
 }