title: Entity Framework complex query
body: <p>i'm trying to learn Entity Framework and I need some help to build my query.
  I have a Post class like this :</p>
  
  <pre><code>public class Post
  {
      public int PostID {get;set;}
      public string Title {get;set;}
      public string Content {get;set;}
      public PostStatus Status {get;set;}
      public IList&lt;Comment&gt; Comments {get; set;}
  }
  </code></pre>
  
  <p>I also have a Comment class :</p>
  
  <pre><code>public class Comment
  {
      public int CommentID {get;set;}
      public string Content {get;set;}
      public CommentStatus Status {get;set;}
  }
  </code></pre>
  
  <p>What I want is to retrieve all Article with Status == PostStatus.Published, including Comment with Status == CommentStatus.Published.</p>
  
  <p>As you understand, I want to display in a blog all published article with their published comment.</p>
  
  <p>I retrieve all published article with all comments, but I only want to get their published comment, not pending ones.</p>
  
  <pre><code>var result = from art in context.Posts.Include("Comments")
               where art.Status == PostStatus.Published
               select art;
  </code></pre>
  
  <p>Thanks for your help</p>