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

Identifier is not a parameter or variable or field

3 Answers 189 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Martin
Top achievements
Rank 1
Martin asked on 17 Oct 2014, 10:25 AM
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?

3 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 21 Oct 2014, 07:02 AM
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.
 
0
Martin
Top achievements
Rank 1
answered on 21 Oct 2014, 07:32 AM
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
0
Thomas
Telerik team
answered on 21 Oct 2014, 11:16 AM
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.
 
Tags
General Discussions
Asked by
Martin
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Martin
Top achievements
Rank 1
Share this question
or