"server side not implemented"

3 posts, 1 answers
  1. XXXX
    XXXX avatar
    57 posts
    Member since:
    Jun 2008

    Posted 20 Feb 2012 Link to this post

    The following code give me a "server side not implemented" error at runtime.
    public IList<short> VisibleBooks(short userID)
    {
      return this.Context.my_roles.Where(r => r.UsersIDs().Contains(userID)).SelectMany<my_role, short>(r => r.VisibleBookIDs()).Distinct<short>().ToList<short>();
    }


    I'm using OA 2011.3.112 against SQLserver 2008.

    I saw an old thread on similar subject where it's stated that it has been fixed but it looks like it doesn't apply to this.
  2. XXXX
    XXXX avatar
    57 posts
    Member since:
    Jun 2008

    Posted 20 Feb 2012 Link to this post

    Found the cause for the error.
    The UsersIDs is a method or extension on the OA role that returns list of user Ids.

    The work around I found was to put the "select" into the LINQ and materialize it before the SelectMany.
    So it looks something like

    public IList<short> VisibleBooks(short userID)
    {
     var tmp = this.Context.my_roles.Where(r => r.users.Select(u => u.UserId).Contains(userID)).ToList();
     return tmp.SelectMany<my_role, short>(r => r.VisibleBookIDs()).Distinct<short>().ToList<short>();
    }
  3. DevCraft banner
  4. Answer
    Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 20 Feb 2012 Link to this post

    Hello Björn,

    OpenAccess cannot look into methods on the persistent types that are beeing called. This is why using the Users collection worked, whereas using UsersIDs() did not. The same applies to VisibleBookIDs().

    Greetings,
    Thomas
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top