title: EF7, what is wrong with my relation here?
body: <p>The relation seams to be find and works with other example but when trying to get with all of the possible Include it fails with the error.</p>
  
  <pre><code> Widget widget = _dbContext.Widgets.Where(w =&gt; w.Id == id)
              .Include(w =&gt; w.DataSource)
                  .ThenInclude(d =&gt; d.DataSourceParams)
                      .ThenInclude(p =&gt; p.DataSourceParamProc)
                         .ThenInclude(s =&gt; s.DataSourceParamProcParams)
              .Include(w =&gt; w.DataSource)
                  .ThenInclude(d =&gt; d.DataSourceParams)
                      .ThenInclude(p =&gt; p.SelectOptions)
              .FirstOrDefault();
  </code></pre>
  
  <p>POCO's:</p>
  
  <pre><code>public class Widget
  {
      public int Id { get; set; }
      public string Title { get; set; }
      public int DataSourceId { get; set; }
      public string Colour { get; set; }
      public string Icon { get; set; }
      public virtual DataSource DataSource { get; set; }
  }
  
  public class DataSource
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public string Description { get; set; }
      public string StoredProc { get; set; }
      public string DataBaseName { get; set; }
      public virtual ICollection&lt;DataSourceParam&gt; DataSourceParams { get; set; }
  }
  
  public class DataSourceParam
  {
      public int Id { get; set; }
      public int DataSourceId { get; set; }
      public string Name { get; set; }
      public int TypeId { get; set; }
  
      public virtual DataSource DataSource { get; set; }
      public virtual DataSourceParamProc DataSourceParamProc { get; set; }
  }
  
  public class DataSourceParamProc
  {
      public int Id { get; set; }
      public string StoredProc { get; set; }
      public string DataBaseName { get; set; }
      [ForeignKey("DataSourceParam")]
      public int DataSourceParamId { get; set; }
      public virtual DataSourceParam DataSourceParam { get; set; }
      public virtual ICollection&lt;DataSourceParamProcParam&gt; DataSourceParamProcParams { get; set; }
  }
  
  public class DataSourceParamProcParam
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public string DefaultValue { get; set; }
      public int DataSourceParamProcId { get; set; }
  }
  
  public class SelectOption
  {
      public int Id { get; set; }
      public string Value { get; set; }
      public string Label { get; set; }
      public int DataSourceParamId { get; set; }
      public virtual DataSourceParam DataSourceParam { get; set; }
  }
  </code></pre>
  
  <p>I'm getting error :</p>
  
  <blockquote>
    <p>A column has been specified more than once in the order by list. Columns in the order by list must be unique.</p>
  </blockquote>
  
  <p>If I comment this line it works:</p>
  
  <pre><code>Widget widget = _dbContext.Widgets.Where(w =&gt; w.Id == id)
              .Include(w =&gt; w.DataSource)
                  .ThenInclude(d =&gt; d.DataSourceParams)
                      .ThenInclude(p =&gt; p.DataSourceParamProc)
                         //.ThenInclude(s =&gt; s.DataSourceParamProcParams)
              .Include(w =&gt; w.DataSource)
                  .ThenInclude(d =&gt; d.DataSourceParams)
                      .ThenInclude(p =&gt; p.SelectOptions)
              .FirstOrDefault();
  </code></pre>
  
  <p>Or If I comment this one it works as well:</p>
  
  <pre><code>Widget widget = _dbContext.Widgets.Where(w =&gt; w.Id == id)
              .Include(w =&gt; w.DataSource)
                  .ThenInclude(d =&gt; d.DataSourceParams)
                      .ThenInclude(p =&gt; p.DataSourceParamProc)
                         .ThenInclude(s =&gt; s.DataSourceParamProcParams)
              //.Include(w =&gt; w.DataSource)
              //    .ThenInclude(d =&gt; d.DataSourceParams)
              //        .ThenInclude(p =&gt; p.SelectOptions)
              .FirstOrDefault();
  </code></pre>
  
  <p>If I separate this it works as well:</p>
  
  <pre><code>       Widget widget = _dbContext.Widgets.Where(w =&gt; w.Id == id)
              .Include(w =&gt; w.ChartAttributes)
                  .ThenInclude(c =&gt; c.ChartAttributeType)  
              .Include(w =&gt; w.WidgetCategory)
              .Include(w =&gt; w.WidgetSeries)
              .Include(w =&gt; w.WidgetType)
              .FirstOrDefault();
  
          DataSource ds = _dbContext.DataSources.Where(d =&gt; d.Id == widget.DataSourceId)
                  .Include(d =&gt; d.DataSourceParams)
                      .ThenInclude(p =&gt; p.SelectOptions)
                  .Include(d =&gt; d.DataSourceParams)
                      .ThenInclude(p =&gt; p.DataSourceParamProc)
                         .ThenInclude(s =&gt; s.DataSourceParamProcParams).FirstOrDefault();
  
          widget.DataSource = ds;
  </code></pre>