title: How to specify left join in EF?
body: <p>My model:</p>
  
  <pre><code>public partial class history_builds
  {
      public int ID { get; set; }
      public int build { get; set; }
      public int br { get; set; }
      public int tag { get; set; }
      public string line { get; set; }
      public int rev { get; set; }
      public int user_ID { get; set; }
      public string distrib_path { get; set; }
      public string setup_path { get; set; }
      public System.DateTime build_date { get; set; }
      public string product { get; set; }
  }
  
  public partial class history_uploads
  {
      public int ID { get; set; }
      public int ID_user { get; set; }
      public string Line { get; set; }
      public int Build { get; set; }
      public string Distrib { get; set; }
      public System.DateTime Time_upload { get; set; }
      public int Status { get; set; }
  }
  
  public partial class user
  {
      public int ID { get; set; }
      public string Name { get; set; }
      public int ID_group { get; set; }
  }
  </code></pre>
  
  <p>Context:</p>
  
  <pre><code>public DbSet&lt;history_builds&gt; history_builds { get; set; }
  public DbSet&lt;history_uploads&gt; history_uploads { get; set; }
  public DbSet&lt;user&gt; users { get; set; }
  </code></pre>
  
  <p>I try to do left join like this <a href="https://stackoverflow.com/questions/5537995/entity-framework-left-join">Entity framework left join</a>  </p>
  
  <pre><code>var items = entities.history_builds
      .Join(
          entities.users.DefaultIfEmpty(),
          hb =&gt; hb.user_ID,
          u =&gt; u.ID,
          (hb, u) =&gt;
              new {
                  hb.distrib_path,
                  hb.setup_path,
                  hb.build_date,
                  hb.build,
                  User = (u == null ? String.Empty : u.Name),
                  hb.rev
              }
      )
      .Join(entities.history_uploads.DefaultIfEmpty(),
          hb =&gt; hb.build,
          hu =&gt; hu.Build,
          (hb, hu) =&gt;
              new HistoryBuidItem {
                  Revision = hb.rev,
                  Build = hb.build,
                  DistribPath = hb.distrib_path,
                  SetupPath = hb.setup_path,
                  BuildDate = hb.build_date,
                  User = hb.User,
                  IsUpload = (hu == null ? true : false)
              }
      )
      .Where(x =&gt; ids.Contains(x.Revision))
      .ToList();
  </code></pre>
  
  <p><strong>But it doesn't work, EF still emit inner join sql code, what is wrong?</strong></p>