title: Is it ok for entities to access repositories?
body: <p>I've just started working with DDD, so maybe this is a silly question...</p>
  
  <p>Is it ok for an entity to access a repository (via some IRepository interface) to get a value at runtime?  For example, I want to enforce a "default" selection for a property:</p>
  
  <pre><code>class Person {
      private Company _employer;
  
      public Company Employer {
          get { return _employer; }
          set { 
              if(value != null) {
                  _employer = value;
              } else {
                  _employer = employerRepository.GetDefaultEmployer();
              }
          }
      }
  
      ...
  }
  </code></pre>
  
  <p>My question is whehter doing something like this is a horrible violation of DDD principles.  And if it isn't, my next question would be what it the best way to provide the repository to use?  Should it be supplied when the Person object is created?  </p>
  
  <p>Thanks,
  P</p>