Skip to content

Query: Use correct column mappings for TVF/FromSql - #21722

Merged
smitpatel merged 1 commit into
masterfrom
smit/mappings
Jul 22, 2020
Merged

smitpatel merged 1 commit into
masterfrom
smit/mappings

Conversation

@smitpatel

Copy link
Copy Markdown
Contributor

Resolves #21511

@ghost

ghost commented Jul 21, 2020

Copy link
Copy Markdown

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.

@smitpatel

Copy link
Copy Markdown
Contributor Author

@msftbot require 1 approval

@ghost

ghost commented Jul 21, 2020

Copy link
Copy Markdown

Hello @smitpatel!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I'll only merge this pull request if it has at least 1 approval

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

break;

default:
table = entityType.GetDefaultMappings().Single().Table;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be cleaner if TableExpressionBase had an ITableBase property

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.

Select/Joins etc also are TableExpressionBase. They don't correspond to any ITableBase.
TableExpressionBase is anything from which you can project out columns. ITableBase correspond to actual database object only so we would need some middle type to hold it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The ITableBase property could be null if there's no database object

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.

I added TableExpressiob.Table & TVFExpression.StoreFunction.
I will revisit if FromSqlExpression should take ITableBase when I work in ToQuerySql API.

@smitpatel
smitpatel merged commit d0ec185 into master Jul 22, 2020
@smitpatel
smitpatel deleted the smit/mappings branch July 22, 2020 02:26
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.

Query: ColumnMappings to use for TVF/FromSql

2 participants