Unfortunately in the current version of the Entity Framework, which ships in .NET 3.5 SP1, we don’t make any attempt to Singularize or Pluralize names when reverse engineering a model from the database.

So if, for example, your database has a table called Orders you will get an EntityType called Orders too, which clearly doesn’t make for the most read-able code:

Orders order = new Orders(); //? why not just Order ?

LINQ to SQL does a better job here, because it ships with simple but effective pluralization and singuralization services, that for the most part produces names you would expect.

Unfortunately the lack of a similar feature in the Entity Framework, means that generally the first thing you do after you’ve reverse engineered a model with the Entity Framework is fix-up all the silly names.

Now from the perspective of someone who delivers plenty of Entity Framework demos, this is quite embarrassing! 

But of course the real problem here is that it is time consuming and error prone for all but the most trivial models.


In the next version we have added basic pluralization support. This support only really handles English, and here’s why:

  1. Creating language and culture aware services is very hard, and we thought it would be better to spend our time working on the core of the Entity Framework.
  2. These sort of services are very general and as such we think that they belong elsewhere, maybe inside Windows itself?
  3. We have made the PluralizationService class public so you are free to write your own.

Our default English language pluralization is then used whenever you generate a model from a database or visa-versa (see model first) to help produce appropriate names.

And for command line users familiar with EdmGen.exe there is a new /pluralize switch also.

Basic Pluralization Rules:

So how does the Entity Framework use this pluralization service?

Well it calls the service to:

  • Singularize EntityType names
  • Singularize NavigationProperty names that point to 0-1 entities
  • Pluralize EntitySet names
  • Pluralize NavigationProperty names that point to 0-* entities

It turns out that if you do this, you get the model you are looking for most of the time.

The Pluralization APIs:

So far we’ve talked about default behavior, if however you need more control, for example if you want to specify custom pluralization rules or a create a completely custom service, you have to drop down to the API level.

Everything revolves around a newly added public PluralizationService class that looks something like this:

public abstract class PluralizationService

        public static PluralizationService CreateService(CultureInfo culture);

        public abstract string Pluralize(string word);
        public abstract string Singularize(string word);

As you can see classes that derive from PluralizationService can singularize and pluralize words.

You can also ask the PluralizationService to create a concrete PluralizationService for you based on Culture (as mentioned previously only “en” based cultures are supported out of the box).

Here is a little code that gets hold of the built-in English Language pluralization services, configures it so “Child” will pluralize to “Children” and then checks that it pluralizes correctly.

PluralizationService pluralizationService = 
        new CultureInfo(“en-US”));

ICustomPluralizationMapping mapping = 
  pluralizationService as ICustomPluralizationMapping;

if (mapping != null) // it shouldn’t be but just checking
//Specifying the child pluralizes as children
    mapping.Add(“Child”, “Children”);

Debug.Assert(pluralizationService.Pluralize(“Child”) == “Children”);

You can use your pluralization service in Model Generation (i.e. the step that produces CSDL and MSL from SSDL) by handing your pluralization service to the EntitySchemaModelGenerator:

//Create an EDM from SSDL generator
EntityModelSchemaGenerator generator =
new EntityModelSchemaGenerator(

//Generate CSDL and MSL (in memory)

The resulting CSDL will have been pluralized/singularized as described in the earlier rules using the provided pluralization service.

See this for more information on the EntityModelSchemaGenerator.


So as you can see we’ve added simple pluralization capabilities, akin to those found in LINQ to SQL, that will reduce the amount of work required to create meaningful models.

And to top it off, the solution we’ve created is easy to customize and public so you can probably use this for other things too!

As always we are very keen to hear what you think.

Alex James
Program Manager

UPDATE: A number of people have asked whether pluralization can be turned off, because the post doesn’t make this clear. The answer is absolutely, pluralization is definitely optional, in Visual Studio this is as simple as checking/unchecking a checkbox in the wizard, and for EDMGen.exe you have to opt-in for pluralization with the /pluralize commandline switch. 

This post is part of the transparent design exercise in the Entity Framework Team. To understand how it works and how your feedback will be used please look at this post.

Comments (13)

  1. Jon Rista says:

    Great news to hear there are some pluralization services. Good to hear they are customizable too.

    I’m also glad  to hear that you are not focusing too much on some extravagant pluralization system, and putting most of your effort into the core of EF. The last article on change tracking was fairly dissapointing, and I think that change tracking is a highly critical component of EF that needs to be addressed properly and thouroughly before the next version of EF is released.

    But pluralization/depluralization is good. 🙂

  2. Mifko says:

    Would be nice to have ability to turn pluralization off.

    If we do not plan to write our custom pluralization service and we use language other than English, then it’s really annoying to end up with words that makes no sense (when pluralization is applied to a foreign language). This happens right now with Linq to Sql.

  3. Pluralization and singularization are great v2 features. In the meantime, Huagati Systems’ DBML/EDMX Tools provide customized naming conventions for classes and member. See


    P.S. Like LINQ to SQL Tools | Options | Database Tools | EDM Designer should have a check box to turn the EF v2 feature on or off.

  4. efdesign says:


    Glad you think this is a good thing to do.


    Don’t worry you will definitely be able to turn pluralization off, in Visual Studio there will be a checkbox in the wizard, and for EDMGen.exe on the commandline the default is not to pluralize you have to use the /Pluralize commandline switch to get pluralization.

  5. Qiang says:

    I think it’s very helpful, thanks.

  6. Marc Scheuner says:

    Bear in mind when designing these pluralization/singularization methods that not everyone is using English names, and the rules for English do *NOT* apply for other languages (e.g. German, French etc.). The Linq-to-Sql method works pretty badly on German table names, and I’d *STRONGLY* argue that any such "automagic" feature needs to be able to turned off when it causes more grief than good….

    What I’d really like to see in EF v2 is a way to specify certain "name transformations" when importing database tables – e.g. our DBA prefixes all tables with "T_" , e.g. T_Orders, so I’d like to be able to tell the EF designer to always remove a leading "T_" (or tbl) prefix from the physical database table name when creating an entity from it. With 3 or 4 tables, it’s no trouble doing this manually – but what if you need to import hundreds of tables, and you need to later update that model???

  7. Kristofer says:

    Looks great.

    To add to what Roger and Marc commented above – my add-in for L2S and EF allows name transformations in addition to singularization/pluralization. This means that in addition to singularization/pluralization you can also remove (or add) prefixes and suffixes, remove underscore separators, apply ProperCase etc.

    See for a full feature list. (Renaming/name transformations is supported for both EF and L2S).

    And if you (MSFT) would like to provide this to all users of EF/L2S already today (as opposed to in VS2010) I would be happy to discuss transferring ownership of my add-in to MSFT. (Suggested already but met with silence so far…)

    The user feedback is great and I think the add-in would be even more popular if it was shipped under the MSFT brand. A couple of people at MSFT have tried it out/evaluated it already so you should be able to hunt down someone internally who can give you feedback on the features supported.

    Best regards,


    Ps. A bunch of new features for EF is in the pipeline; EDMX cleanup is currently in beta, incremental DDL generation is under development. (DDL generation from L2S models is already supported and was RTMd a bit over a week ago…)

  8. Alex D James says:


    Sorry I didn’t make this clear in the post… I updated the post yesterday to (see the bottom) to indicate that this pluralization is optional. I will follow-up with the tools team to ensure that the check-box talked about is off by default for locales other than English



  9. Alex D James says:


    Just for an update. By default in the wizard the checkbox is off of non-english locales.

    There was a debate internally about making it off and disabling it too in these situations. But we decided some people may still want to use this anyway.



  10. David Nelson says:

    I agree that a more general mechanism is need for name transformation than just pluralization. When dealing with large databases, the amount of effort it takes to transform names from db conventions to code conventions can be overwhelming. And there is no reason why the majority of that effort can’t be handled automatically, if a facility is available to do it.

  11. Benjamin Janecke says:

    @AlexJ goog decision not disabling it but turning it off only. I work for a German company and we name our tables English so the pluralization feature will still be useful for us. Though I must confess that we use the English version of Visual Studio anyway because of the poor German translation (which is, however, still a lot better than in Windows Vista) 😉

  12. Tanveer Badar says:

    There are two pain points for me in EF in this regard, not related to pluralization/singularization.

    Name generation/inference in EF is not on par with other features. I can’t manually renamed 45 tables and a couple of hundred properties because EF copied names as it is.

    First one has been closed as by design, second one is still active. And honestly, its the second one which needs much more attention.

  13. Idsa says:

    I think it would be more convenient if we could set custom pluraluzation-serivice at designer or at app.config.

Skip to main content