title: Error: Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context
body: <p>I have the code below: </p>
  
  <pre><code>public ActionResult OnDemand()
  {
      List&lt;SiteMenu&gt; all = new List&lt;SiteMenu&gt;();
      using (MyDatabaseEntities dc = new MyDatabaseEntities())
      {
          all = dc.SiteMenus.Where(a =&gt; a.ParentMenuID.Equals(0)).ToList();
      }
  
      return View(all);
  }
  </code></pre>
  
  <p>...but I get the error: Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context</p>
  
  <p>...the error occurs on the following line:</p>
  
  <pre><code>all = dc.SiteMenus.Where(a =&gt; a.ParentMenuID.Equals(0)).ToList();
  </code></pre>
  
  <p>Could I get some help as to what I'm doing wrong? ...Thanks in Advance</p>