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

Assumptions are correct till they are not #22254

Merged
1 commit merged into from
Aug 27, 2020
Merged

Assumptions are correct till they are not #22254

1 commit merged into from
Aug 27, 2020

Conversation

smitpatel
Copy link
Member

Query: Get mapped projection from associated query expression

Since projection binding can come from parent query expression too

Resolves #12239

@smitpatel smitpatel requested a review from a team August 26, 2020 20:03
@smitpatel
Copy link
Member Author

@Pilchie for RC1 approval

@Pilchie
Copy link
Member

Pilchie commented Aug 26, 2020

Approved for RC1.

Since projection binding can come from parent query expression too

Resolves #12239
@ghost
Copy link

ghost commented Aug 26, 2020

Hello @smitpatel!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 8fff1f6 into release/5.0 Aug 27, 2020
@ghost ghost deleted the smit/issue1239 branch August 27, 2020 01:10
@alexandis
Copy link

Still getting this error in EfCore5. What am I doing wrong below?

variable 'articleTexts' of type 'System.Collections.Generic.IEnumerable`1[AbxEps.Fines.LawArticles.LawArticleDetail]' referenced from scope '', but it is not defined

           var articlesQuery =
                dbSet.Select(x => new { x.TenantId, x.LawArticleId }).Distinct()
                .GroupJoin(
                    dbSet,
                    x => new { x.TenantId, x.LawArticleId },
                    x => new { x.TenantId, x.LawArticleId },
                    (articleId, articleTexts) => new
                    {
                        ArticleId = articleId,
                        ArticleTexts = articleTexts
                    }
                )
                .SelectMany(
                    x => x.ArticleTexts,
                    (all, articleDetail) => new { ArticleId = all.ArticleId, ArticleTexts = all.ArticleTexts }
                )
                .Select(x => new LawArticleAggregated
                {
                    TenantId = x.ArticleId.TenantId,
                    LawArticleId = x.ArticleId.LawArticleId,
                    ArticleTexts = x.ArticleTexts.ToList()
                });

@smitpatel
Copy link
Member Author

@alexandis - Please file a new issue with a runnable code and exception+stack trace you are seeing.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using variable in a .Select() from parent .SelectMany() scope I get an InvalidOperationException
4 participants