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); }
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); }