views:

197

answers:

2

Possible Duplicate:
Pluralize - Singularize

The C# 4.0 (maybe older versions, but I've only tested with 4.0) Linq-to-SQL generator will pluralize your table names; even tough plurals like Territory. It knows that Territories is the plural. Is there anyway to access this pluralization function?

A: 

I'm not sure the Linq to SQL inflector is publicly accessible, but if you need an inflector you could use SubSonic's inflector, NCommon, uNhAddins, Castle ActiveRecord, etc.

Mauricio Scheffer
+14  A: 

System.Data.Entity.Design.PluralizationServices.PluralizationService

EDIT Linking the (older) answer in the (older) question, as eglasias suggests. Go forth and upvote, he deserves the rep.

Ben Voigt
Why are there more upvotes for my answer than people voting to mark the question as a duplicate?
Ben Voigt
Because it's a whole lot easier to click on the "good answer" button? There's no "mark as duplicate" button immediately visible.
Jim Mischel
Because the second mouse gets the cheese. In the old post, Daniel gave the same answer, got 1 upvote, and has 86 reputation at the time that this is being written. Life can be SO unfair.
Windows programmer
Come on. Obviously it’s because only like 1% of SO users have enough rep to vote to close.
Timwi
@Timwi Wow, your approximation was spot on. 1.44% to be more exact.
NullUserException
@Ben: because I don't think it's a duplicate, since it is about the LINQ to SQL algorithm, not just general.
John Saunders
This is just golden!
Geoff
There, 1 more vote to close as duplicate without voting for this answer / also 1 more vote to the answer in the other/original question. imho when doing this you should always link to the other answer as well in here.
eglasius
@Ben Voigt, possibly because you linked to the documentation and he just gave class name. He'll learn.
RBerteig
@John: It is a duplicate because the requirement for being closed as a duplicate is that the question has been fully covered by an earlier question, not that both questions have identical scope. The other question and answers completely cover this one.
Ben Voigt
@Ben: I didn't see Daniel's answer first time. Voted to close. Also, upvoted Daniel's answer and edited it to include link to documentation.
John Saunders