FluentValidation rule for multiple properties

What about:

RuleFor(m => new {m.CountyId, m.Zip}).Must(x => ValidZipCounty(x.Zip, x.CountyId))
                                      .WithMessage("Wrong Zip County");

Leave a Comment