I am using MVC5 and trying to make a simple list. I used scaffolds that create the model as IQueryable in the controller, and IEnumerable in the view. I am trying to change the view in the same way as IQueryable, but the view gives compilation errors in "The type or namespace" IQueryable "cannot be found (do you miss the using directive or assembly references?) '
@using System.Linq
@model IEnumerable<MyTableName>
@model IQueryable<MyTableName>
All my projects are 4.5.2. I am a relative newbie to MVC / EF. I reference System.Core.dll both in my web application and in my data project.
When I start, I get the following exception: error CS1061: "IQueryable" does not contain a definition for "MyTableName", and the extension method "MyTableName" cannot be found that takes the first argument of the type "IQueryable" (are you missing the using directive or assembly reference?)
I want IQueryable because 1) there is a lot of data and 2) I will use Infragistics controls (which are not currently on the page). I want to get only the data I need. (I am new to Infragistics, but all the Infragistics links are off page.)
Any suggestions? Thank you
source
share