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 http://www.huagati.com/dbmltools/.

    –rj

    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:

    @Jon

    Glad you think this is a good thing to do.

    @Mifko

    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 http://www.huagati.com/dbmltools/ 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,

    Kristofer

    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. AlexJ says:

    @Marc

    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

    Regards

    Alex

  9. AlexJ says:

    @Marc

    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.

    Regards

    Alex

  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.

    https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=374920

    https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=374922

    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.