This is a migrated thread and some comments may be shown as answers.

Getting Count... The method or operation is not implemented.

3 Answers 149 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
George
Top achievements
Rank 1
George asked on 20 Mar 2009, 06:23 PM
I'm having problems getting the count of a linq query using OpenAccess, and I'm not sure why:

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);  
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

3 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 23 Mar 2009, 03:07 PM
Hello Kuba Cole,
You found a bug in our release that has been fixed already. The workaround is to execute the query and call count on the result (.ToList().Count).

The fix will be available in the next patch. This might be available in 2-3 weeks.

Kind regards,
Jan Blessenohl
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
George
Top achievements
Rank 1
answered on 23 Mar 2009, 07:31 PM
So, do I get 100 million-gazillion Telerik point????  :)

LOL, just kidding... I haven't used the points I have!!

Thanks as Always!

Kuba
0
Dimitar Kapitanov
Telerik team
answered on 24 Mar 2009, 08:45 AM
Hello Kuba Cole,
We updated your Telerik points, and we scheduled the fault behavior for maintenance.

All the best,
Dimitar Kapitanov
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
LINQ (LINQ specific questions)
Asked by
George
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
George
Top achievements
Rank 1
Dimitar Kapitanov
Telerik team
Share this question
or