private static ValidationRuleInstance[] GetValidation(Action <IRuleExpression <TMessage, TCommand> > validation) { var validationModel = new ValidationDefinition <TMessage, TCommand>(); validation(validationModel); return(validationModel.GetInstances()); }
public ICommandConfigurationExpression <TMessage, TCommand> Enforce( Action <IRuleExpression <TMessage, TCommand> > validation, Action <IRuleOptionsExpression <TCommand> > options) { var validationModel = new ValidationDefinition <TMessage, TCommand>(); validation(validationModel); options(validationModel); _CommandDefinition.AddValidationRules(validationModel.GetInstances()); return(this); }