Error returned using statement to retrieve single column from table
Options
var query = from a in UserInformationList select a.Id;
query.Dump();
I want to take advantage of Skip() and Take() so I want this to be a C# statement
Error:
NotSupportedException: Individual properties can only be selected from a single resource or as part of a type. Specify a key predicate to restrict the entity set to a single instance or project the property into a named or anonymous type.
query.Dump();
I want to take advantage of Skip() and Take() so I want this to be a C# statement
Error:
NotSupportedException: Individual properties can only be selected from a single resource or as part of a type. Specify a key predicate to restrict the entity set to a single instance or project the property into a named or anonymous type.
Comments
-
You can encapsulate the (single) column in an anonymous type:
var query = from a in UserInformationList select new { a.Id }; query.Skip(2).Take(2).Dump();
Results in (Request Log panel):http://server/svc/UserInformationList()?$skip=2&$top=2&$select=Id
-
I was able to get this to work with the following:
var query = (
from b in UserInformationList
select new
{
b.Id
}) .Skip(100).Take(100).Dump();