title: Get data Self reference
body: <p>I have a self reference model.
  I  want get data with linq.i want when status is ok return data.but if parent status is ok all of child return ok or pending or deleted.
  how can i do this.</p>
  
  <pre><code>var model = _efComment.List(p =&gt; p.PostId == postId);
          var list = model.ToList()
              .Where(p =&gt; p.ComentStatus == ComentStatus.Ok)
              .Where(x =&gt; x.Reply == null)
              .ToList();using System.Collections.Generic;
  </code></pre>
  
  <hr>
  
  <pre><code>using System.ComponentModel.DataAnnotations.Schema;
  using DomainModel.Classes;
  
  namespace DomainModel
  {
      public class Comment : BaseFieldsTables
      {
          public string Content { get; set; }
          public string WriterName { get; set; }
          public string WriterEmail { get; set; }
          public string WriterWebsite { get; set; }
  
          public int PostId { get; set; }
  
          [ForeignKey("PostId")]
          public Post Post { get; set; }
  
          public Comment Reply { set; get; }
  
          public int? ReplyId { get; set; }
          public ICollection&lt;Comment&gt; Children { get; set; }
          public ComentStatus ComentStatus { get; set; }
      }
  }
  namespace DomainModel
  {
      public enum ComentStatus
      {
          Ok = 1,
          Pending = 2,
          Deleted = 3
      }
  }
  </code></pre>