title: Unable to create a constant value of type 'System.Object'. Only primitive types ('such as Int32, String, and Guid') are supported in this context
body: <p>I'm using MVC and Entity Framework.  I've created a class in my model folder with this code below.  I keep getting the error message above with both queries below.  I know there is a known issue on referencing non-scalar variables, but I'm not sure how to implement a workaround:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/bb896317.aspx#Y1442">http://msdn.microsoft.com/en-us/library/bb896317.aspx#Y1442</a></p>
  
  <pre><code>private MovieLibraryDBEntities movieLibraryDBEntitiesContext;
  
  public int getNumberOfEntriesReserved()
  {
      return (from m in movieLibraryDBEntitiesContext.Movies
              where m.CheckedOut.Equals(1)
              select m).Count();
  
      //return movieLibraryDBEntitiesContext.Movies
      //  .Where(e =&gt; e.CheckedOut.Equals(1))
      //  .Select (e =&gt; e.Title).Count();
  }
  </code></pre>