I have two properties that must be validated, but once at a time. If one is null then validate the other, so I was trying like this :
RuleFor(a => a.CNPJ).Must(a => CNPHelper.CheckCNPJ(a)).When(a => !string.IsNullOrEmpty(a.CPF));
RuleFor(a => a.CPF).Must(a => CNPHelper.CheckCPF(a)).When(a => !string.IsNullOrEmpty(a.CNPJ));
But the must is mandatory, how to change it ?