Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using Humanizer #11160

Closed
anpete opened this issue Mar 5, 2018 · 10 comments · Fixed by #20577
Closed

Consider using Humanizer #11160

anpete opened this issue Mar 5, 2018 · 10 comments · Fixed by #20577
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@anpete
Copy link
Contributor

anpete commented Mar 5, 2018

Roslyn has taken a dependency on this lib for pluralization: http://humanizr.net

“Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities.”

Features

• Humanize String
• Dehumanize String
• Transform String
• Truncate String
• Format String
• Humanize Enums
• Dehumanize Enums
• Humanize DateTime
• Humanize TimeSpan
• Humanize Collections
• Inflector methods
• Pluralize
• Singularize
• Adding Words
• ToQuantity
• Ordinalize
• Titleize
• Pascalize
• Camelize
• Underscore
• Dasherize & Hyphenate
• Fluent date
• Number to Numbers
• Number to words
• Number to ordinal words
• Roman numerals
• Metric numerals
• ByteSize

@ajcvickers
Copy link
Contributor

ErikEJ commented 2 days ago
@bricelam suggests adding Humanizer as a default pluralizer for Reverse eng. See ErikEJ/EFCorePowerTools#243 - willing to do a PR if there is interest in this?

ErikEJ commented 2 days ago
Should it be an additional NuGet package, like your EF6 pluralizer, @bricelam ?

bricelam commented 2 days ago •
No, I think EFCore.Design can reference Humanizer directly

@ajcvickers
Copy link
Contributor

Note: this should only ever be a design-time dependency.

ErikEJ added a commit to ErikEJ/EntityFramework that referenced this issue Apr 9, 2020
ErikEJ added a commit to ErikEJ/EntityFramework that referenced this issue Apr 19, 2020
@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label May 1, 2020
@bricelam bricelam modified the milestones: Backlog, 5.0.0 May 1, 2020
bricelam pushed a commit to ErikEJ/EntityFramework that referenced this issue May 14, 2020
bricelam pushed a commit to ErikEJ/EntityFramework that referenced this issue Jun 15, 2020
bricelam pushed a commit to ErikEJ/EntityFramework that referenced this issue Jun 16, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0, 5.0.0-preview7 Jun 22, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0-preview7, 5.0.0 Nov 7, 2020
@Grauenwolf
Copy link

I'm starting to see complaints about this breaking workflows. Was there a reason why this new feature was enabled by default instead of being opt-in?

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 23, 2020

@Grauenwolf
Copy link

That explains why it is available, not why it was necessary to make it the default, introducing a breaking change.

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 23, 2020

Why

Using plural forms of words for collection properties and singular forms for types and reference properties is idiomatic in .NET.

@ajcvickers
Copy link
Contributor

@Grauenwolf To expand on Erik's comments, we chose to make a breaking change here because we believe that the long term benefit to customers outweighs the short-term cost. This is based on:

  • Feedback over the years from the first version of classic EF through EF Core 5 indicates that a large majority of customers want this behavior. (We could be wrong.)
  • The change required to keep using the old behavior is trivial--a single flag to set
  • The break is in a tooling scenario, which means it won't break running applications without notice. (It is in a tooling scenario that is often scripted, but changing the script should be simple.)

@Grauenwolf
Copy link

So what happens when Humanizer is updated to fix the numerous spelling errors it introduces?

Will EF Core pick up the new version, introducing bragging changes again, or are we stuck with any misspellings?

@ajcvickers
Copy link
Contributor

@Grauenwolf We intend to pick up the new version. The reason we couldn't do that in EF6 is because the pluralizer changed runtime behavior. In EF Core it only impacts tooling behavior, and we consider it acceptable to fix bugs like misspellings in tooling.

@Grauenwolf
Copy link

Thank you for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants