public DefinirPalestranteCommandValidator(IPalestraRepository repository) { RuleFor(x => x.PalestraId) .NotEmpty() .MustAsync(async(id, cancellationToken) => await repository.Exists(id)) .WithMessage(Messages.IdNotFound); }