No, I do not want Set in the name of my EntitySet

Roger Jennings wrote about this (well, ranted is probably a more appropriate word ;-) ) last week. I finally came across it today and see why he was so annoyed. I am revising all of my early book chapters to line up with the release version of Entity Framework. In doing so, I am going through all of the walk-throughs and one of them is to create a model from a database with about 15 tables. Some of the tables have singular names, which means that I need to edit the EntitySet names to be plural.

But some of the tables have plural names. The EntitySet names are perfect. I need to change the Entity names to be singular. That's where I see the effect that set Roger off.

I understand that if I'm creating a new entity and naming it, the designer needs to have something for the default. In this case appending "Set" is a lot safe than just appending an "s". But editing the entity name also triggered the behavior and my EntitySet names got changed as well. If I'm editing the Entity name, I most likely won't want the EntitySet name to be automatically changed.

It's surely aggravating. But all I can do in my book is point it out and explain what to do about it.

If I had a lot of tables in the database that this happened to, I'd be much more annoyed. You definitely need the designer for this because the Entity name change reverberates through the entire CSDL and MSL and you don't want to have to do that by hand.

Roger makes a great point of highlighting Huagati's LINQ to SQL & EF tool  that includes a naming tool for the model. I've had this tool bookmarked for quite a while but have been focused on my main task. Luckily Roger has taken the time to check it out (for an upcoming VS Mag article on tools for LINQ to SQL, which also includes Damien Guard's T4 template (with VB support, three cheers for Damien!!) which is also on my list, but mostly everything is on hold at this point until I get my book edits done... :-()

(okay, long sentence which went down a few roads... deep breath... back to the plural entity set names...)

So, the behavior will definitely get highlighted and explained.

IdeaBlade's DevForce has a model naming feature in it as well. Maybe they can do a community service and split that feature out as a free download! :-) Although I believe that works with their custom designer so it may not be possible.

#1 Roger Jennings on 9.27.2008 at 4:36 PM

Julie,You're right about my post being a rant!However, I was most annoyed by the EF devs adding a "stealth feature" that no one seems to have wanted. All they needed to do was take advantage of the setting for LINQ to SQL's singularization/pluralization in the Options dialog.Good luck with the edits. I'm just starting mine.Cheers,--rj

#2 Noam Ben-Ami on 9.30.2008 at 3:37 PM

The EF team has heard this feedback loud and clear and is working on resolving this issue in the next release. (If only it were as simple as just taking advantage of LINQ to SQL's settings!)

Leave a Comment