Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Jan 28, 2026

Closes #37575

@roji roji requested a review from a team as a code owner January 28, 2026 07:41
Copilot AI review requested due to automatic review settings January 28, 2026 07:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request obsoletes the FromSqlInterpolated and ExecuteSqlInterpolated methods in favor of the newer FromSql and ExecuteSql methods. These method pairs are functionally identical (both accept FormattableString), and the PR aims to simplify the API surface by steering users toward the preferred naming convention.

Changes:

  • Added [Obsolete] attributes to FromSqlInterpolated, ExecuteSqlInterpolated, and ExecuteSqlInterpolatedAsync methods with clear guidance to use the newer alternatives
  • Updated test code throughout the codebase to use the new method names
  • Added pragma warnings around tests that specifically verify behavior of the obsolete methods
  • Updated code comments that referenced the obsolete method names

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/EFCore.Relational/Extensions/RelationalQueryableExtensions.cs Added [Obsolete] attribute to FromSqlInterpolated<TEntity> method
src/EFCore.Relational/Extensions/RelationalDatabaseFacadeExtensions.cs Added [Obsolete] attributes to ExecuteSqlInterpolated and ExecuteSqlInterpolatedAsync methods
src/EFCore/Query/Internal/ExpressionTreeFuncletizer.cs Updated comment to reference FromSql() instead of obsolete method
src/EFCore.Analyzers/InterpolatedStringUsageInRawQueriesCodeFixProvider.cs Updated comment to reference FromSql instead of obsolete method
test/EFCore.SqlServer.FunctionalTests/Query/AdHocMiscellaneousQuerySqlServerTest.cs Updated test to use FromSql instead of obsolete method
test/EFCore.Relational.Specification.Tests/Query/SqlExecutorTestBase.cs Updated tests to use ExecuteSql/ExecuteSqlAsync instead of obsolete methods
test/EFCore.Relational.Specification.Tests/Query/FromSqlQueryTestBase.cs Updated tests to use FromSql instead of obsolete method
test/EFCore.Relational.Specification.Tests/Query/Inheritance/TPTInheritanceQueryTestBase.cs Added pragma warnings around test that verifies obsolete method behavior
test/EFCore.Relational.Specification.Tests/Query/Inheritance/TPCInheritanceQueryTestBase.cs Added pragma warnings around test that verifies obsolete method behavior
test/EFCore.CrossStore.FunctionalTests/QueryTest.cs Added pragma warnings around test that verifies obsolete method behavior

@roji roji enabled auto-merge (squash) January 28, 2026 08:10
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.

Obsolete FromSqlInterpolated, ExecuteSqlInterpolated

1 participant