예제 #1
0
        private ValidationResult ValidateInternalValidationStep(T command, ValidationStep step)
        {
            var validationStep = step as InternalValidationStep <T>;
            var result         = step.IsAsync
                ? Task.Run(() => validationStep.AsyncValidateFunction(command), new CancellationToken()).GetAwaiter().GetResult()
                : validationStep.ValidateFunction(command);

            return(result);
        }
예제 #2
0
        private ValidationResult ValidateExternalValidationStep(T command, ValidationStep step)
        {
            var validationStep = step as IExternalValidationStep;
            var result         = step.IsAsync
                ? Task.Run(() => validationStep.Validate(), new CancellationToken()).GetAwaiter().GetResult()
                : validationStep.Validate();

            return(result);
        }