Search code examples
c#entity-frameworkentity-framework-corepluralize

Where is EnglishPluralizationService in EF Core 2.0?


EF Core 2.0 still has its conventions and it can change plural to singular and singular back to plural. Thus it definitely has the pluralization service built into it.

Yet I can't find this service to use it for other purposes.

In EF 6, I would write:

using System.Data.Entity.Infrastructure.Pluralization;

// Then somewhere in code
var englishPluralizationService = new EnglishPluralizationService();
var singularCat = englishPluralizationService.Singularize("Cats");

Solution

  • There is no built in pluralization in EF Core, but you can hook in for example the Inflector package: https://www.nuget.org/packages/Inflector/

    I do that in "EF Core Power Tools" - see https://github.com/aspnet/EntityFrameworkCore/commit/dda3f43c046c2464f4813fdbb4261a6146aa4432 for more info