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

Select only specific column for included table result in multiple round trip to server #9297

Closed
MaklaCof opened this issue Jul 29, 2017 · 2 comments

Comments

@MaklaCof
Copy link

I think this should transform to single query but it does not:

    var result= this.context.MainTable
        .Include(t => t.DetailTable)
        .Select(t => new {
            id = t.Id,
            values = t.DetailTable.Select(t2 => t2.SomeField)
        })
        .ToArray();

First query is run to query MainTable and then for each row in MainTable another query is run to get SomeField value from DetailTable.
I am using EF 1.1.2.

I though that I am doing something wrong, so I ask question on SO, but it was suggested that this is a bug.

@smitpatel
Copy link
Contributor

Following up on this on Stackoverflow.

@maumar
Copy link
Contributor

maumar commented Jul 31, 2017

dupe of #4007. #9282 (stretch goal for 2.1 release would solve this)

@maumar maumar closed this as completed Jul 31, 2017
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants