Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I rename entity framework .edmx file

I have a new MVC 4 project developed by a third party. I want to rename the .edmx file before making some other changes and going to production. I can rename the file itself but the .tt files do not change.

like image 251
Alan Fisher Avatar asked Jun 30 '14 18:06

Alan Fisher


People also ask

How do you change a .edmx file?

Update the .edmx file when the Database changes In the Model Browser, right-click the . edmx file and select Update Model from Database. Expand the Tables, Views, and Stored Procedures nodes, and check the objects you want to add to the .

What the .edmx file contains?

An . edmx file is an XML file that defines an Entity Data Model (EDM), describes the target database schema, and defines the mapping between the EDM and the database. An . edmx file also contains information that is used by the ADO.NET Entity Data Model Designer (Entity Designer) to render a model graphically.

How do I open a .edmx XML file?

Right-click on your EDMX file, select Open With…, then select XML (Text) Editor. Boom, there is your entire EDMX file as Visual Studio and . Net sees it, in all its XML wonderfulness.


1 Answers

I need to rename my edmx, the designer, diagram and both T4 template files. This is what I did -

  1. Unload the project in VS, edit, rename all above files to whatever you have to. The first part of the name of all these files should be same.
  2. Open project directory in Windows explorer and manually rename all above files. Names should exactly match with what you entered in project file in step 1.
  3. Open both tt files, find and replace the original edmx file name there.
  4. Open EDMX file in a text editor, find and replace with
  5. Reload the project, right click both the tt files one at a time and Run Custom tool. This will regenerate any missing files.
like image 139
Arpit Khandelwal Avatar answered Sep 27 '22 19:09

Arpit Khandelwal