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

4 posts, 0 answers
  1. Greg Figueroa
    Greg Figueroa avatar
    82 posts
    Member since:
    Apr 2005

    Posted 20 Mar 2009 Link to this post

    I'm having problems getting the count of a linq query using OpenAccess, and I'm not sure why:

    1 CustomerGet(int startRow, int returnRows, string colList,   
    2             string filterExp, string sortExp, string apiKEY)  
    3 {  
    4   IObjectScope os = ObjectScopeProvider1.GetNewObjectScope();  
    5   var isFilter = !string.IsNullOrEmpty(filterExp);  
    6   var isSort = !string.IsNullOrEmpty(sortExp);  
    7   IQueryable query;  
    8   int queryCount = 0;  
    9  
    10   query = os.Extent<Customer>();  
    11  
    12   query = query.  
    13     Where(isFilter ? filterExp : "CustomerID > 0").  
    14     OrderBy(isSort ? sortExp : "CustomerName ASC").  
    15     Select("new(" + colList + ")");  
    16  
    17   queryCount = query.Count();  
    18  
    19   query = query.Skip(startRow).Take(returnRows);  
    20
    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
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 23 Mar 2009 Link to this post

    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.
  3. DevCraft banner
  4. Greg Figueroa
    Greg Figueroa avatar
    82 posts
    Member since:
    Apr 2005

    Posted 23 Mar 2009 Link to this post

    So, do I get 100 million-gazillion Telerik point????  :)

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

    Thanks as Always!

    Kuba
  5. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 24 Mar 2009 Link to this post

    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.
Back to Top