title: Fluent validation and Must custom validation
body: <p>I have a class and my validation looks like this:</p>
  
  <pre><code>    public ValidationResult Validate(CustomerType customerType)
      {
          CustomerType Validator validator = new CustomerTypeValidator();
          validator.RuleFor(x =&gt; x.Number).Must(BeUniqueNumber);
  
          return validator.Validate(customerType);
      }
  
      public bool BeUniqueNumber(int number)
      {
          //var result = repository.Get(x =&gt; x.Number == customerType.Number)
          //                       .Where(x =&gt; x.Id != customerType.Id)
          //                       .FirstOrDefault();
  
          //return result == null;
          return true;
      }
  </code></pre>
  
  <p>The CustomerTypeValidator is a basic validator class that validates string properties. </p>
  
  <p>I also add a new rule to check if the number is unique in the db. I do it in this class because there's a reference to the repository. The validator class has no such reference.</p>
  
  <p>The problem here is that the BeUniqueNumber method should have a CustomerType parameter. However when I do this, I get an error on the RuleFor line above because 'Must' needs an int as a parameter.</p>
  
  <p>Is there a way around this?</p>