title: MVC 5 with Fluent validation with two nullable datetimes ensuring end greater than start
body: <p>In an MVC 5 app I'm trying to compare two nullable date time with the code below.  It works fine however if I enter the same date for both start and end it is failing validation.   How can I amend this code so I can enter a start and end date both with the same date?</p>
  
  <pre><code> RuleFor(m =&gt; m.StartDate)
          .NotEmpty()
          .WithMessage("Start Date is Required");
  
      RuleFor(m =&gt; m.EndDate)
          .NotEmpty().WithMessage("End date is required")
          .GreaterThan(m =&gt; m.StartDate.Value)
                          .WithMessage("End date must after Start date")
          .When(m =&gt; m.StartDate.HasValue);
  </code></pre>