title: Entity Framework Entity SQL Query for Left Outer Join that returns Nulls from count on Virtual Collect
body: <p>I'm trying to write a Entity SQL query on a virtual collection in a table.</p>
  
  <p>The main model looks like this:</p>
  
  <pre><code>public class Person { 
          [Key] 
          public string person_id { get; set; }
  
          public string UserId { get; set; }
  
          [ForeignKey("UserId")]
          public virtual ApplicationUser User { get; set; }
  
          public virtual ICollection&lt;Media&gt; Media { get; set; }
  
          public string username { get; set; }
      }
  </code></pre>
  
  <p>And the virtual collection is defined like this:</p>
  
  <pre><code>public class Media
          {
              [Key]
              public string media_id { get; set; }
  
              public string UserId { get; set; }
  
              [ForeignKey("UserId")]
              public virtual ApplicationUser User { get; set; }
  
              public virtual ICollection&lt;Person&gt; People { get; set; }
  
              public DateTime? created_time { get; set; }
          }
  </code></pre>
  
  <p>I want to find the NULL's or where virtual collection is zero.</p>
  
  <p>I have implemented the following but it seems like it does an equal join, rather than a left outer join.</p>
  
  <pre><code>var people = await db.People.Where(q =&gt; q.Media.Count() == 0).ToListAsync();
  </code></pre>
  
  <p>Can someone help me figure out what I'm missing?</p>
  
  <p>Thank you!</p>