This question is locked. New answers and comments are not allowed.
I'm having problems getting the count of a linq query using OpenAccess, and I'm not sure why:
When it hits the query.Count(), the dymanic linq library blows up with The method or operation is not implemented. The query works fine when it returns, but the Count function seems to have a problem.
Does anyone have any idea why?
Thanks, Kuba
CustomerGet(int startRow, int returnRows, string colList, | |
string filterExp, string sortExp, string apiKEY) | |
{ | |
IObjectScope os = ObjectScopeProvider1.GetNewObjectScope(); | |
var isFilter = !string.IsNullOrEmpty(filterExp); | |
var isSort = !string.IsNullOrEmpty(sortExp); | |
IQueryable query; | |
int queryCount = 0; | |
query = os.Extent<Customer>(); | |
query = query. | |
Where(isFilter ? filterExp : "CustomerID > 0"). | |
OrderBy(isSort ? sortExp : "CustomerName ASC"). | |
Select("new(" + colList + ")"); | |
queryCount = query.Count(); | |
query = query.Skip(startRow).Take(returnRows); | |
} |
Does anyone have any idea why?
Thanks, Kuba