0

I am looking for a way to ensure StartDate parameter is always lower than optional EndDate parameter. I know CompareAttribute does something similar where it verifies that two parameters are equal, but I cannot find anything for greater/lower than another parameter. Is there something I missed or maybe a library with some extra validation annotations I could use? If not then I will need to make a custom attribute for this check. I specifically want an attribute check as it integrates with the rest of my application nicely.

Note: StartDate is a DateOnly EndDate is a DateOnly?

Luk164
  • 657
  • 8
  • 22
  • [This answer](https://stackoverflow.com/a/3401178/8551479) explains how you can use `IValidatableObject` to do custom validation. – P. Magnusson Mar 16 '23 at 11:27

0 Answers0