views:

88

answers:

1

I'm using Entity Framework's model designer to design the model for a new project.

Adding properties is relatively easy, however they're always appended to the entity.

Is there a way to reorder the properties once they've been added? This is quite annoying!

+3  A: 

I assume by "reorder the properties" you mean the order that the properties are show up in the EDM designer and if that's what you mean then Yes, there is:
1. Right Click on your edmx file in solution explorer and choose "Open With..."
2. Select the 2nd item: Automatic Editor Selector(XML) and click OK.
3. Click on Yes where it ask if you want to close the edmx file.
4. Now you should see the XML file that is being created behind the scene.
5. Find your EntityType node that you need to reorder its properties: it is in the CSDL content like: < EntityType Name="yourEntityName">. Underneath there are a whole bunch of property nodes: < Property Type="" Name=""... Change the order of the scalar properties, save and double click on the edmx file to open it in designer mode again... You'll see that the order has been changed!

Morteza Manavi
Thanks, but wow. I was hoping for drag-and-drop or a keyboard shortcut. Even just being able to reorder alphabetically would have been welcome!
Drew Noakes