title: FluentValidation check start date greater than end date
body: <p>I have this C# code with FluentValidation rule which check start date should be less than end date. When I run to put start date greater than end date, it should show error &quot;End date must after Start date&quot;.</p>
  <pre><code>        RuleFor(r =&gt; r.StartDate)
         .NotEmpty()
         .WithMessage(&quot;Start Date is Required&quot;);
  
          RuleFor(r =&gt; r.EndDate)
              .NotEmpty().WithMessage(&quot;End date is required&quot;)
              .GreaterThan(r =&gt; r.StartDate.Value)
                              .WithMessage(&quot;End date must after Start date&quot;)
              .When(m =&gt; m.StartDate.HasValue);
  </code></pre>
  <p>In my model, these 2 properties defined as below:</p>
  <pre><code>    [DataType(DataType.Date)]
      [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = &quot;{0:yyyy-MM-dd}&quot;)]
      public DateTime? StartDate { get; set; }
  
      [DataType(DataType.Date)]
      [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = &quot;{0:yyyy-MM-dd}&quot;)]
      public DateTime? EndDate { get; set; }
  </code></pre>