Hi,
My situation is. I have a validator trying to make sure the user has not entered a future date. so I have a validator like this.
How could I work around this issue? or disable the caching altogether?
Thanks,
J.
My situation is. I have a validator trying to make sure the user has not entered a future date. so I have a validator like this.
public class BasedViewModelValidator<T> : AbstractValidator<T> where T : BasedViewModel
{
public BasedViewModelValidator()
{
RuleFor(x => x.TradeDate).LessThan(DateTime.Now.Date.AddDays(1));
}
}
The issue is that the InstanceCache "cached" the validator instance and would render the rule invalid after one day.How could I work around this issue? or disable the caching altogether?
Thanks,
J.