title: Only primitive types or enumeration types are supported in this context
body: <p>So I have this code:</p>
  
  <pre><code>    public int saleCount(List&lt;Shift&gt; shifts) {
          var query = (
              from x in database.ItemSales
              where shifts.Any(y =&gt; y.ID == x.shiftID)
              select x.SalesCount
          );
          return query.Sum();
      }
  </code></pre>
  
  <p>Unfortunately, it's throwing this error:</p>
  
  <pre><code>Unable to create a constant value of type 'Shift'. 
  Only primitive types or enumeration types are supported in this context.
  </code></pre>
  
  <p>So here is where I define shift, which is just a normal Entity Framework Code First object:</p>
  
  <pre><code>[Table("Shifts")]
  public class Shift : MPropertyAsStringSettable {
      [Key]
      [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
      public int ID { get; set; }
      public int SiteID { get; set; }
      public string ShiftID_In_POS { get; set; }
      public DateTime ShiftDate { get; set; }
  }
  </code></pre>
  
  <p>I guess the problem is that I am using Shift object in a Linq query.  And I am doing a "Any" operation on a List of "Shift".</p>
  
  <p>One possible solution is to change the List to maybe a Collection or something, afterall, I am loading it with a linq query somewhere else, but what would the signature be?</p>