/// <summary> /// Validates whether the configured Sending PMode is valid and can be used. /// </summary> /// <param name="messagingContext">Message used during the step execution.</param> /// <returns></returns> public Task <StepResult> ExecuteAsync(MessagingContext messagingContext) { var result = SendingProcessingModeValidator.Instance.Validate(messagingContext.SendingPMode); if (result.IsValid) { return(StepResult.SuccessAsync(messagingContext)); } string description = result.AppendValidationErrorsToErrorMessage($"Sending PMode {messagingContext.SendingPMode.Id} was invalid:"); return(StepResult.FailedAsync(new MessagingContext(new ConfigurationErrorsException(description)))); }