Skip to content

bricelam/EFCore.Pluralizer

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Bricelam.EntityFrameworkCore.Pluralizer

latest version downloads license

This project is a working sample that adds design-time pluralization to Entity Framework Core.

Usage

To use the package, simply install it. The pluralizer will be used when reverse engineering a model from an existing database.

Console:

dotnet add package Bricelam.EntityFrameworkCore.Pluralizer
dotnet ef dbcontext scaffold "Data Source=chinook.db" Microsoft.EntityFrameworkCore.Sqlite

PMC:

Install-Package Bricelam.EntityFrameworkCore.Pluralizer
Scaffold-DbContext 'Data Source=chinook.db' Microsoft.EntityFrameworkCore.Sqlite

How it works

On install, the package adds an assembly-level attribute to the project:

[assembly: DesignTimeServicesReference(
    "Bricelam.EntityFrameworkCore.Design.EFCorePluralizerServices, Bricelam.EntityFrameworkCore.Pluralizer")]

This attribute points to a class that registers the IPluralizer service.

class EFCorePluralizerServices : IDesignTimeServices
{
    public void ConfigureDesignTimeServices(IServiceCollection services)
        => services.AddSingleton<IPluralizer, Pluralizer>();
}

At design time, EF Core will find the assembly-level attribute and call the ConfigureDesignTimeServies method to register additional services.

About

Adds design-time pluralization to EF Core

Resources

License

Stars

Watchers

Forks

Packages

No packages published