public Derived1DtoValidator(KnxAddressValidator <Derived1Dto> knxAddressValidator) { RuleFor(_ => _.Number) .LessThan(0) .When(_ => _.IsNegative) ; RuleFor(_ => _.KnxAddress) .SetValidator(knxAddressValidator) ; }
public Derived2DtoValidator(BaseDtoValidator baseValidator, KnxAddressValidator <Derived2Dto> knxAddressValidator) { RuleFor(o => o) .SetValidator(baseValidator) ; RuleFor(_ => _.Temperature) .ExclusiveBetween(10F, 30F) ; RuleFor(_ => _.KnxAddress) .SetValidator(knxAddressValidator) ; RuleFor(_ => _.KnxAddress2) .SetValidator(knxAddressValidator) ; }