Repository navigation
Fix typos - #38487
Merged
Merged
Fix typos#38487
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a collection of correctness bugs and inconsistencies across EF Core query/update/scaffolding infrastructure (plus some doc/comment typos), with new regression coverage for a scaffolding edge-case.
Changes:
- Fixes multiple expression-tree equality/quoting issues (e.g.,
ROW_NUMBER()quoting, JSON/OpenJson equality semantics). - Aligns sync/async behavior and async hygiene (FK propagation guard parity,
ConfigureAwait(false)usage). - Fixes several small correctness issues (operator precedence, off-by-one/bounds guards, rows-affected diagnostics).
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/EFCore.Design.Tests/Scaffolding/Internal/CandidateNamingServiceTest.cs | Adds regression coverage for scaffolding navigation naming when stripping Id would otherwise yield an empty name. |
| src/EFCore/Query/ReplacingExpressionVisitor.cs | Micro-optimization: uses ReferenceEquals for replacement matching. |
| src/EFCore/Query/Internal/QueryableMethodNormalizingExpressionVisitor.cs | Clarifies rationale for skipping SequenceEqual conversion. |
| src/EFCore/ChangeTracking/Internal/ValueGenerationManager.cs | Aligns async FK propagation guard with sync (!IsUnknown). |
| src/EFCore.SqlServer/Storage/Internal/SqlServerTransientExceptionDetector.cs | Comment typo fix (“occurred”). |
| src/EFCore.SqlServer/Query/Internal/SqlExpressions/SqlServerOpenJsonExpression.cs | Fixes child visitation copy loop and corrects/integrates equality/hash behavior. |
| src/EFCore.SqlServer.Abstractions/HierarchyId.cs | XML doc spacing typo fix. |
| src/EFCore.Sqlite.Core/Query/Internal/SqlExpressions/JsonEachExpression.cs | Fixes child visitation copy loop (index increment bug). |
| src/EFCore.Sqlite.Core/Migrations/Internal/SqliteHistoryRepository.cs | Adjusts async retry delay await configuration. |
| src/EFCore.Relational/Update/AffectedCountModificationCommandBatch.cs | Improves stored-procedure concurrency exception to report actual affected rows. |
| src/EFCore.Relational/Query/SqlExpressions/RowNumberExpression.cs | Fixes quoting constructor args to include partitions and correct ordering element type. |
| src/EFCore.Relational/Query/SqlExpressions/JsonScalarExpression.cs | Fixes equality contract by including base.Equals. |
| src/EFCore.Relational/Metadata/IReadOnlyRelationalPropertyOverrides.cs | Comment typo fix (“overridden”). |
| src/EFCore.InMemory/Query/Internal/InMemoryExpressionTranslatingExpressionVisitor.cs | Fixes precedence bugs via added parentheses. |
| src/EFCore.Design/Scaffolding/Internal/CandidateNamingService.cs | Prevents StripId from returning empty strings for prefixes like _Id. |
| src/EFCore.Design/Query/Internal/PrecompiledQueryCodeGenerator.cs | Comment typo fix (“occurred”). |
| src/EFCore.Design/Extensions/ScaffoldingModelExtensions.cs | Comment typo fix (“whether”). |
| src/EFCore.Cosmos/Storage/Internal/SessionTokenStorage.cs | Uses ArgumentException.ThrowIfNullOrWhiteSpace consistently for whitespace checks. |
| src/EFCore.Cosmos/Query/Internal/CosmosQueryableMethodTranslatingExpressionVisitor.cs | Simplifies warning condition for row-limiting ops without ordering. |
| src/ef/Commands/MigrationsBundleCommand.cs | Guards against IndexOfAny returning -1 when slicing runtime identifiers. |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Simplified GetHashCode method to only include ColumnInfos count.
cincuranet
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Systematic review of the codebase surfaced a set of latent bugs and inconsistencies that could only have been introduced by imperfect sentient beings.
Summary of fixes
RowNumberExpression.Quote()(wrong/missing constructor args broke precompiledROW_NUMBERqueries),JsonScalarExpression.Equals(missingbase.Equals, breaking theEquals/GetHashCodecontract), andSqlServerOpenJsonExpression.Equals(invertedSequenceEqualon column paths).ValueGenerationManager.PropagateAsyncnow applies the same!IsUnknownguard as the sync path when propagating FK values.InMemoryExpressionTranslatingExpressionVisitor).CandidateNamingService.StripIdno longer returns an empty navigation name for prefixes like_Id;MigrationsBundleCommandguards againstIndexOfAnyreturning-1.AffectedCountModificationCommandBatchreports the actual rows-affected count (not a hardcoded0) in stored-procedure concurrency exceptions.SqliteHistoryRepositoryretry delay now usesConfigureAwait(false).SessionTokenStorageusesArgumentException.ThrowIfNullOrWhiteSpaceconsistently.ReplacingExpressionVisitorusesReferenceEqualsinstead ofEquals.the<see,occured,wheter,overriden).