Identifier is not a parameter or variable or field

4 posts, 0 answers
  1. Martin
    Martin avatar
    10 posts
    Member since:
    Nov 2009

    Posted 17 Oct 2014 Link to this post

    Hi,

    I have the following statement using Telerik OpenAccess:

    var pageContent = (from pageObj in cmsdata.Objects_latests
                                       from stackVer in cmsdata.Content_stack_versions
                                       from contentVer in cmsdata.Content_versions
                                       where pageObj.Page_no == _pageno
                                       && pageObj.Stack_id == stackVer.Stack_id
                                       && stackVer.Version_no == stackVer.Content_stack.Latest_version
                                       && contentVer.Content_no == stackVer.Content_no
                                       orderby contentVer.Created descending
                                       select contentVer).ToList();

    The error I get is:

    Failure: Identifier 'Version_no' is not a parameter or variable or field of 'CMSEditor.DataAccess.Objects_latest'. If 'Version_no' is a property please add the FieldAlias or Storage attribute to it or declare it as a field's alias.



    I don't understand - I am not attempting to access the "Version_no" attribute of "Objects_latest".  I am attempting to access it on the Content_stack_versions class, where it does exist.

    After rearranging the code in various ways, it appears that no matter what class I attempt to access properties of, it errors as if it is attempting to access it on the object in the first from statement.

    I feel like I am missing something fundamental, is anyone able to assist?
  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 21 Oct 2014 Link to this post

    Unfortunately, this looks like a bug. Even more unfortunately, there seems to be no workaround. The issue only exists when using SelectMany(); maybe you can reformulate this query to use Join()?

    We will provide a fix for this issue in one of our next versions, but I cannot give you a concrete date yet.
    Thanks for reporting this issue with us; I've updated your Telerik points.

    Regards,
    Thomas
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
  3. DevCraft banner
  4. Martin
    Martin avatar
    10 posts
    Member since:
    Nov 2009

    Posted 21 Oct 2014 in reply to Thomas Link to this post

    Hi,

    Thanks for the response, I added a view to my database that lets me select this information without needing to do the joins in linq.

    Let me know if you need any additional information about my configuration to look into this issue.

    Cheers
  5. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 21 Oct 2014 Link to this post

    Thanks for providing this nice workaround here. 

    I did reproduce the issue here, no more information needed at this time; thanks for the offer!

    Regards,
    Thomas
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
Back to Top