Skip to content

Query: Allow translations through DTO objects - #8198

Merged
smitpatel merged 1 commit into
devfrom
transparentdistinct
Apr 19, 2017
Merged

smitpatel merged 1 commit into
devfrom
transparentdistinct

Conversation

@smitpatel

Copy link
Copy Markdown
Contributor

DTO which are projected out, (from any level) are materialized correctly with typed projection shaper
Store member bindings for MemberInitExpression to allow binding after DTO projection

Resolves #7234

@smitpatel
smitpatel requested review from anpete and maumar and removed request for maumar April 17, 2017 22:56
@smitpatel
smitpatel force-pushed the transparentdistinct branch from e47ca0b to 292cc97 Compare April 17, 2017 23:00
var newMemberInitExpression = base.VisitMemberInit(memberInitExpression);

var selectExpression = QueryModelVisitor.TryGetQuery(_querySource);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRY this with VisitNew

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on the complex logic of finding member id in NewExpression (since newExpression.Members can be null), it provides no value to DRY it.

if (sourceBinding is MemberAssignment memberAssignment)
{
var sourceExpression = memberAssignment.Expression;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not TryGetValue?

@smitpatel
smitpatel force-pushed the transparentdistinct branch from 292cc97 to 5e4b2c7 Compare April 18, 2017 17:53
@smitpatel

Copy link
Copy Markdown
Contributor Author

Updated.

@smitpatel
smitpatel force-pushed the transparentdistinct branch 2 times, most recently from 0c69949 to 88953c4 Compare April 18, 2017 20:54
DTO which are projected out, (from any level) are materialized correctly with typed projection shaper
Store member bindings for MemberInitExpression to allow binding after DTO projection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants