Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when navigation property which named "Parent" #182

Closed
leehom0123 opened this issue Jul 12, 2018 · 3 comments
Closed

Error when navigation property which named "Parent" #182

leehom0123 opened this issue Jul 12, 2018 · 3 comments

Comments

@leehom0123
Copy link

leehom0123 commented Jul 12, 2018

There has an error when navigation property which named "Parent".

Here is the entity code:

public class A {
    public A Parent{get;set;}
    public List<A> Children {get;set;}
    public int Id{get;set;}
}

IQueryable<A> query = ......;
query.Sort("Parent.Id");    //exception: No 'parent' is in scope
@rev319303
Copy link

Was an answer to this ever found?

@MaklaCof
Copy link

By the way, I also found out that select doesn't work when property name is DateTime.

@StefH
Copy link
Collaborator

StefH commented Jan 18, 2019

There are some reserved keyword like Parent and it.

The solution is to escape the property name with @, so @Parent.Id and @DateTime.

@StefH StefH closed this as completed Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants