title: Why won't this LINQ join statement work?
body: <p>I have this LINQ-query:</p>
  
  <pre><code>    // types...
      LinkedList&lt;WeightedItem&gt; itemScores = new LinkedList&lt;WeightedItem&gt;();
  
      var result = from i in _ctx.Items
                   join s in itemScores on i.Id equals s._id
                   orderby s._score descending
                   select new ItemSearchResult(i, s._score);
  
      // this fails:
      return result.ToList();
  </code></pre>
  
  <p>Which is generating this error:</p>
  
  <blockquote>
    <p>Unable to create a constant value of type 'System.Collections.Generic.IEnumerable`1'.<br>
    Only primitive types ('such as Int32, String, and Guid') are supported in this context.</p>
  </blockquote>
  
  <p><strong>[EDIT]</strong> Here's the code of <code>WeightedItem</code>:</p>
  
  <pre><code>public class WeightedItem
  {
      public int _id;
      public decimal? _score;
  
      public WeightedItem(int id, decimal? score)
      {
          _id = id;
          _score = score;
      }
  }
  </code></pre>
  
  <p>Can you see what I've done wrong? The code compiles perfectly and both the _ctx.Items and itemScores contains proper values.</p>