I have a gallery entity framework class, and I'm trying to use the Dynamic Linq library hosted on ScottGu's blog to request a set of objects. A faulty line of code reads:
return context.Galleries.OrderBy(sidx + " " + sord).Skip(page * rows).Take(rows).ToList();
sidx == "Name" and sord == "desc".
The Gallery object has a Name property. However, upon execution, I get the following exception:
A "name" may not be permitted in the current area or context. Ensure that all referenced variables are in the area that require schema loading, and that the namespaces are correctly specified., Near a simple identifier, row 6, column 1.
Does anyone know what that means?
source
share