title: Shared repositories in repository pattern
body: <p>Repository dependency? Lets say I have a domain that looks like the following:</p>
  
  <pre><code>public class User
  {
      public int UserId { get; set; }
      public Lazy&lt;Post&gt; Posts { get; set; }
  }
  
  public class Post
  {
      public int PostId { get; set; }
      public User Poster { get; set; }
  }
  </code></pre>
  
  <p>A user with my posts.</p>
  
  <p>How do I set up my repository so that for every <code>user</code>, it returns a list of <code>Post</code> and for every <code>post</code>, I get the <code>Poster</code>?</p>
  
  <p>I have 2 repositories:</p>
  
  <pre><code>public class UserRepository : IUserRepository
  {
      public IQueryable&lt;User&gt; GetUsers();
  }
  
  public class PostRepository : IPostRepository
  {
      public IQueryable&lt;Post&gt; GetPosts();
  }
  </code></pre>
  
  <p>I tried calling from 1 repository to the other, but it ends up in a crash because there is a circular dependency.</p>
  
  <p>I'm using the POCO method of the repository pattern with entity framework.</p>