public CategoryValidator(ValidateFor mode) { this.RuleFor(x => x.Name).NotEmpty(); if (mode == ValidateFor.Create) { this.RuleFor(x => x.Id).Length(0); } else { this.RuleFor(x => x.Id).NotEmpty(); } }
public ConfigValidator(Config config, string workdir) { ValidationLevel = ValidateFor.All; _config = config; _workdir = workdir; }