title: Should I validate inside DDD domain project?
body: <p>I want to validate my domain model entities using <a href="https://www.nuget.org/packages/FluentValidation/" rel="noreferrer">FluentValidation</a>. I have read <a href="https://stackoverflow.com/questions/10879421/domain-validation-in-a-cqrs-architecture#answer-10999427">an answer about validation in DDD</a> that has used FluentValidation for validating his entity. Here is how he validate its entity:</p>
  
  <pre><code>public class ParticipantValidator : AbstractValidator&lt;Participant&gt;
  {
      public ParticipantValidator(DateTime today, int ageLimit, List&lt;string&gt; validCompanyCodes, /*any other stuff you need*/)
      {...}
  
  public void BuildRules()
  {
           RuleFor(participant =&gt; participant.DateOfBirth)
                  .NotNull()
                  .LessThan(m_today.AddYears(m_ageLimit*-1))
                  .WithMessage(string.Format("Participant must be older than {0} years of age.", m_ageLimit));
  
          RuleFor(participant =&gt; participant.Address)
              .NotNull()
              .SetValidator(new AddressValidator());
  
          RuleFor(participant =&gt; participant.Email)
              .NotEmpty()
              .EmailAddress();
          ...
  }
  
  }
  </code></pre>
  
  <p>So my Domain Project is depend on FluentValidation library.</p>
  
  <p>But I think it is bad Idea that my Domain Project depends on third party library. How I can prevent this problem?</p>