title: Only entity types, enumeration types or primitive types are supported in this context
body: <p>I'm currently working on a search page. I need to only return a list of themedetails for themes that contain all of the themetag id's that are stored in the int[] ST. Currently the line (ST == null ? true : ST.Contains(b.ThemeTagID)) seems to give me an error</p>
  
  <p>Additional information: Unable to create a null constant value of type 'System.Int32[]'. Only entity types, enumeration types or primitive types are supported in this context.</p>
  
  <pre><code>    public ActionResult Index(int ProviderID = 0, string Description = null, int[] ST = null)
      {
  
          var themedetail = from t in db.ThemeDetail
                            from b in t.ThemeTags
                            where (
                            (string.IsNullOrEmpty(Description) ? true : t.Description.ToLower().Contains(Description.ToLower())) &amp;&amp;
                            (ProviderID == 0 ? true : t.ProviderID == ProviderID) &amp;&amp;
                            (ST == null ? true : ST.Contains(b.ThemeTagID))
                                )
                            select t;
  
          ViewBag.ProviderID = new SelectList(db.ProviderDetails, "ProviderID", "ProviderName");
          ViewBag.MultiselectFeatures = new MultiSelectList(db.ThemeFeatures, "ThemeFeatureID", "ThemeFeaturesName");
          ViewBag.MultiselectTags = new MultiSelectList(db.ThemeTags, "ThemeTagID", "TagName");
  
          return View(themedetail.ToList());
      }
  </code></pre>
  
  <p>The Models are...</p>
  
  <pre><code>[Table("ThemeDetail")]
  public class ThemeDetail : Entity
  {
      [Required]
      [Display(Name = "Name")]
      public string ThemeName { get; set; }
      public ThemeDetail()
      {
          ThemeFeatures = new List&lt;ThemeFeature&gt;();
          ThemeTags = new List&lt;ThemeTag&gt;();
          ThemeImages = new List&lt;ThemeImage&gt;();
      }
  
      public virtual ICollection&lt;ThemeFeature&gt; ThemeFeatures { get; set; }
      public virtual ICollection&lt;ThemeTag&gt; ThemeTags { get; set; }
      public virtual ICollection&lt;ThemeImage&gt; ThemeImages { get; set; }
  }
  
  [Table("ThemeTags")]
  public class ThemeTag
  {
      [Key]
      [Display(Name = "Theme Tag ID")]
      public int ThemeTagID { get; set; }
  
      [Display(Name = "Tag Name")]
      [Required]
      public string TagName { get; set; }
  
      public virtual ICollection&lt;ThemeDetail&gt; ThemeDetail { get; set; }
  }
  </code></pre>