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

Question: How to get related entities only one field #139

Closed
zqxin45 opened this issue Jan 19, 2018 · 2 comments
Closed

Question: How to get related entities only one field #139

zqxin45 opened this issue Jan 19, 2018 · 2 comments
Assignees

Comments

@zqxin45
Copy link

zqxin45 commented Jan 19, 2018

in the select tests:

var test = _context.Blogs.Select("new (BlogId, Name, Posts)").ToDynamicArray();

it's doesn't support get related entities only one field,how to implement it

var test = _context.Blogs.Select("new (BlogId, Name, Posts.PostId)").ToDynamicArray();
@StefH StefH self-assigned this Jan 20, 2018
@StefH
Copy link
Collaborator

StefH commented Jan 20, 2018

In your example : A Blog contains Posts (multiple), you cannot access Posts.PostId.

The example would work the other way around:

var test = _context.Posts.First().Select("new (PostId, Title, Blog.BlogId)").ToDynamicArray();

@zqxin45
Copy link
Author

zqxin45 commented Jan 22, 2018

thanks

@StefH StefH closed this as completed Jan 26, 2018
@StefH StefH changed the title how to get related entities only one field Question: How to get related entities only one field Mar 30, 2018
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

2 participants