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!
Delete existing model and then update: Delete key to delete all models in the designer. IMPORTANT: Do not save the EDMX at this point if you are using TFS for source control!* Now right-click and select "Update Model from Database" to recreate the entire model again. Rebuild project to propagate changes.
An . edmx file is an XML file that defines a conceptual model , a storage model , and the mapping between these models. An . edmx file also contains information that is used by the ADO.NET Entity Data Model Designer (Entity Designer) to render a model graphically.
edmx is basically an XML file which is generated when we added Entity Framework model. It is Entity Data Model Xml which contains designer (Model) and code file(. cs).
In VS2012 it's much easier: just press alt + up/down with the property selected.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With