If I have a property in a view model like:
[DataType(DataType.DateTime)]
public DateTime? MyDate{ get; set; }
And a validation rule like this:
public class YourDetailsViewModelValidator : AbstractValidator<YourDetailsViewModel>
{
public YourDetailsViewModelValidator()
{
RuleFor(x => x.MyDate)
.InclusiveBetween(startDate, endDate)
.WithMessage("error");
}
}
Why does the error fire regardless of what date is input?
I did see a similar thing was happening enter link description herebut the answer was ultimately accepted so I'm hoping it can be made to work properly.