Good evening,
What I am missing with the current .SetValidator(..) implementations is a way to pass along / work with the validation context's instance of T - is there any way to do this? E.g. that sub-validator might require information/data from the parent object of the property passed along for validation
Comments: Hi Jeremy, What if I am already using a custom validator like this: __public class ValidatePassportExpiryValidator : PropertyValidator, IHasClientValidator {}__ which I just pass to my Rule like this: __RuleFor(x=> x.StringPassportExpiryDate) .SetValidator(new ValidatePassportExpiryValidator()).WithLocalizedMessage(() => Step2.InvalidPassportExpiryDate);__ Currently it doesn't allow me to pass anything to my validator class Can you please help. Thanks in advance.
What I am missing with the current .SetValidator(..) implementations is a way to pass along / work with the validation context's instance of T - is there any way to do this? E.g. that sub-validator might require information/data from the parent object of the property passed along for validation
Comments: Hi Jeremy, What if I am already using a custom validator like this: __public class ValidatePassportExpiryValidator : PropertyValidator, IHasClientValidator {}__ which I just pass to my Rule like this: __RuleFor(x=> x.StringPassportExpiryDate) .SetValidator(new ValidatePassportExpiryValidator()).WithLocalizedMessage(() => Step2.InvalidPassportExpiryDate);__ Currently it doesn't allow me to pass anything to my validator class Can you please help. Thanks in advance.