1
votes

Whenever I update my EDMX from a database, it overwrites all changes I have made to my entity model definitions. This is problematic because some tables have multiple foreign keys to the same table; ex:

Table Lobby
HostId - INT FKey(Person.PersonId)
GuestId - INT FKey(Person.PersonId)

Table Person
PersonId - INT PKey

Entity Framework is defaulting my Lobby entity's Person properties with Person and Person1; I want it to use Host and Guest to refer to these foreign key relationships.

1
Are you renaming the properties inside the designer, or are you changing it in the source file? - Rand Random
My designer file is just comments describing how to enable legacy code generation. I've been modifying the source files directly. I've updated the OP to show the comments. - jokulmorder
I wasnt talking about the .desginer.cs file, but the designer inside visual studio that pops up when you open the EDMX file. You have to change the name in ther to make changes persistant in you source code, since the EDMX autogenerates your source codes with a t4 template. - Rand Random
Ahh, that did work. I thought updating the EDMX would change it there too, apparently not! Thanks. - jokulmorder
Made my comment to answer so you may accept it. - Rand Random

1 Answers

1
votes

Comment to answer: I wasnt talking about the .desginer.cs file, but the designer inside visual studio that pops up when you open the EDMX file. You have to change the name in ther to make changes persistant in you source code, since the EDMX autogenerates your source codes with a t4 template.