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

Query: Disallow FromSql/TVF with TPT #21725

Merged
1 commit merged into from
Jul 22, 2020
Merged

Query: Disallow FromSql/TVF with TPT #21725

1 commit merged into from
Jul 22, 2020

Conversation

smitpatel
Copy link
Member

  • Throw exception when using FromSql* methods
  • Throw if a TVF is mapped to TPT
  • Throw if construction of SelectExpression with custom TableExpression is done when TPT

Resolves #21508

@@ -130,6 +131,13 @@ public override void Validate(IModel model, IDiagnosticsLogger<DbLoggerCategory.
throw new InvalidOperationException(RelationalStrings.DbFunctionInvalidReturnEntityType(
dbFunction.ModelName, dbFunction.ReturnType.ShortDisplayName(), elementType.ShortDisplayName()));
}

if (entityType.BaseType != null || entityType.GetDerivedTypes().Any()
&& entityType.GetDiscriminatorProperty() == null)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that we support TPH, do we have any tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably not tests but it just works due to design.

Base automatically changed from smit/mappings to master July 22, 2020 02:26
- Throw exception when using FromSql* methods
- Throw if a TVF is mapped to TPT
- Throw if construction of SelectExpression with custom TableExpression is done when TPT

Resolves #21508
@ghost
Copy link

ghost commented Jul 22, 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 b23e0ac into master Jul 22, 2020
@ghost ghost deleted the smit/blocks branch July 22, 2020 05:11
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.

Query: Disallow FromSql on TPT/TPC
2 participants