Where is promocode coming from? The Must method has overloads accepting Func<TProp,bool>
, Func<T,TProp,bool>
, and Func<T,TProp, PropertyValidatorContext, bool>
If promocode is a property of the object being validated, it would be easy to pass something like
.RuleFor(x => x.UserProfile).Must( (o, userProfile) => { return IsValid(o.promoCode, userProfile); })