Hi,
I have a Expiry Date property the can have either Date or Relative Expiration Date.
How would I define it using Fluent Validation?
pseudo code:
I have a Expiry Date property the can have either Date or Relative Expiration Date.
- In case of Date the format should be "dd-MMM-yyyy".
-
In case of Relative Expiration Date the format should be, for example, "3W" for three weeks.
How would I define it using Fluent Validation?
pseudo code:
RuleFor(dto => dto.ExpiryDate).IsValidDate().Or().IsValidRaltiveDateExpression()
Where IsValidDate() and IsValidRaltiveDateExpression() are extension methods to set the validators and Or() is what I'm after.