Entity Framework 4: Any way to know the plural form of an Entity Type?

While working on a project I came across the need to identify what the entity set name is so I can use that to add an updated entity to the set. In order to identify the plural I came up with two options:

  • Use the Pluralization service to figure out the entity set name: The problem with this is that you assume the plural is always the entity set name which is not a guarantee.
  • Use the following command: YourEntityObject.EntityKey.EntitySetName

I ended up using the second option as that will always return the Entity set name but it is good to know how to “calculate” the entity set if you need to.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.