Skip to content

Fix: PascalCaseNamingConvention splits consecutive uppercase acronyms (AutoMapper #4593 backport)#9

Open
gthen95 wants to merge 1 commit intoNET-Sorcery:mainfrom
gthen95:fix/pascal-case-acronyms
Open

Fix: PascalCaseNamingConvention splits consecutive uppercase acronyms (AutoMapper #4593 backport)#9
gthen95 wants to merge 1 commit intoNET-Sorcery:mainfrom
gthen95:fix/pascal-case-acronyms

Conversation

@gthen95
Copy link
Contributor

@gthen95 gthen95 commented Mar 19, 2026

Description

This PR backports a fix from AutoMapper (#4593) to address an issue where PascalCaseNamingConvention incorrectly splits consecutive uppercase letters (acronyms).

The Issue:
When mapping properties containing acronyms like FormXML, the Split method previously separated every single uppercase letter (Form, X, M, L), causing the mapping convention to fail to match the properties.

The Fix:
Updated the splitting condition to verify if the current uppercase letter is surrounded by other uppercase letters. It now correctly identifies acronyms and keeps them intact (e.g., FormXML correctly splits into Form and XML).

References:

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.

PascalCaseNamingConvention is splitting "FormXML" to "Form" "X" "M" "L"

1 participant