public SyncValidator() { RuleFor(c => c.Path) .NotEmpty() .WithMessage(StringRes.BadReqInvalidPath); RuleFor(c => c.FullPath) .NotEmpty() .Must(f => IsValidPath(f)) .WithMessage(StringRes.BadReqInvalidPath); RuleFor(c => c.FullPath) .Must(f => !f.EndsWith("mstx") || IsPackageHashValid(f)) .WithMessage(StringRes.BadReqInvalidPackage); RuleFor(c => c.Platform) .NotEmpty() .Must(p => Platforms.IsValidPlatform(p)) .WithMessage(StringRes.BadReqInvalidPlatform); RuleFor(x => x) .Must(x => ProgrammingLanguages.IsValidLanguage(x.Language, x.Platform)) .WithMessage(StringRes.BadReqInvalidLanguage); }