Skip to content

Fix UUID suffix handling in scaffolded navigation names - #38929

Merged
AndriySvyryd merged 1 commit into
dotnet:mainfrom
z0rimo:fix-38767-uuid-navigation-naming
Sep 10, 2026
Merged

AndriySvyryd merged 1 commit into
dotnet:mainfrom
z0rimo:fix-38767-uuid-navigation-naming

Conversation

@z0rimo

@z0rimo z0rimo commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #38767

Summary

  • Handle Uuid suffixes when deriving scaffolded navigation property names.
  • Add regression coverage for foreign key names such as FileUuid and QuestionUuid.

Before this change, CandidateNamingService.StripId() handled the Guid suffix specially, but Uuid was treated as a regular Id suffix, resulting in names such as FileUu and QuestionUu.

Tests

  • CandidateNamingServiceTest: 14/14 passed.
  • The full EFCore.Design.Tests run has one unrelated failure in TextTemplatingModelGeneratorTest.GenerateModel_reports_compiler_errors on my Windows environment.
  • The unrelated failure also reproduces when run in isolation.
  • I've read the guidelines for contributing and seen the walkthrough

  • I've posted a comment on an issue with a detailed description of how I am planning to contribute and got approval from a member of the team

  • The code builds and tests pass locally (also verified by our automated build checks)

  • Commit messages follow this format:

    Summary of the changes

    • Detail 1
    • Detail 2

    Fixes #bugnumber

  • Tests for the changes have been added (for bug fixes / features)

  • Code follows the same patterns and style as existing code in this repo

- Handle UUID suffixes when deriving scaffolded navigation names
- Add regression tests for UUID foreign key names

Fixes dotnet#38767
@z0rimo
z0rimo requested a review from a team as a code owner September 7, 2026 01:20
@z0rimo
z0rimo marked this pull request as draft September 7, 2026 01:20
@z0rimo

z0rimo commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@z0rimo
z0rimo marked this pull request as ready for review September 7, 2026 07:06
@AndriySvyryd
AndriySvyryd requested a balanced review from Copilot September 10, 2026 00:24
@AndriySvyryd AndriySvyryd self-assigned this Sep 10, 2026

@AndriySvyryd AndriySvyryd left a comment

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.

Thanks for your contribution!

Copilot AI left a comment

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.

🟢 Approval recommended

The focused implementation correctly addresses the reported naming defect and includes regression coverage.

Pull request overview

Fixes scaffolded navigation names by correctly stripping Uuid suffixes.

Changes:

  • Treats Uuid like Guid during suffix removal.
  • Adds regression tests for FileUuid and QuestionUuid.
File summaries
File Description
src/EFCore.Design/Scaffolding/Internal/CandidateNamingService.cs Adds case-insensitive Uuid suffix handling.
test/EFCore.Design.Tests/Scaffolding/Internal/CandidateNamingServiceTest.cs Verifies expected navigation names.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@AndriySvyryd
AndriySvyryd merged commit 76746ab into dotnet:main Sep 10, 2026
16 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 11, 2026
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.

DB Scaffold Misnamed Navigation Properties ending in "Uuid"

3 participants