I'm using jqGrid and I have a problem getting Dynamic Linq to work. I used NuGet to install Dynamic and added "using System.Linq.Dynamic;".
Using VS 2010 Pro, MVC 3.0
This works:
var s = context.testdata;
var c = s.Count();
c shows 5136 items.
But I cannot get the dynamic approach to work:
var s = context.testdata.OrderBy("id asc");
I get this error message:
'id' could not be resolved in the current scope or context.
Make sure that all referenced variables are in scope,
that required schemas are loaded, and that namespaces are referenced correctly.
This however does work:
var s = (from ss in context.testdata
orderby ss.id
select ss).ToList();
var c = s.Count();
Again I get all 5136 items.
I've got the code from here:
http://haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx
and here:
http://www.timdavis.com.au/code/jquery-grid-with-asp-net-mvc/
Any idea what I am doing wrong?