Dai
Dai

Reputation: 155558

ADO.NET Entities 3.5 - Plural naming broken?

I'm building a data model using ADO.NET Entity Framework 3.5 in Visual Studio 2008 SP1.

when I create the model from my database the object names are all plural rather than singular, for example, in my database I have a table called "Persons". ADO.NET calls the type name "Persons".

This contrasts with Linq-to-SQL where the designer/generator gives the entities singular names.

Annoyingly, if I rename each entity to its singular name ("Person") the designer renames their Entity Set Name to "PersonSet", so I have to rename that back to the plural.

Is this some configuration thing I've overlooked or is this somehow 'by design' in ADO.NET EF?

Upvotes: 1

Views: 478

Answers (2)

Dai
Dai

Reputation: 155558

I solved the problem by using the third-party add-in Huagati DBML Tools: http://www.huagati.com/dbmltools/ which performs pluralisation of entity names.

Upvotes: 0

Eranga
Eranga

Reputation: 32447

There is a option "Pluralize or singularize generated object names" in the Ado.Net model creation wizard. Untick that option

enter image description here

Image taken from Dan's answer

Upvotes: 2

Related Questions