rvrn22 / nmg

NHibernate Mapping generator from existing database tables

Home Page:http://www.ranjan.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PascaleCase TableName become Tablename

wutever0 opened this issue · comments

e.g. ServiceRelatedRequest table gets generated as Servicerelatedrequest domain class regardless of configurations.

Seems the TextInfo.ToTitleCase method considers the text "ServiceRelatedRequest" as one word and simply converts that to "Servicerelatedrequest".

When receiving the text as "Service_Related_Request" it converts it correctly to ServiceRelatedRequest.

Workaround
I found that the AbstractTextFormatter had a line to add these underscores but was commented out (TextFormatter.cs Line 32). When I uncommented this line it fixed ClassNames but generated property names (which were originally PascalCase) with underscore. Explicity using the "PascalCase" configuration option worked around this.