0

My Foreign Key Name in SQL is

FK_Employee_Departmemt_Source FK_Employee_Departmemt_Status

but when i add Employee and Department table in EDMX, Entity Framework automatically change their names to

Department Department1

I want it to be remain the same, Kindly help.

Thanks

manav inder
  • 3,531
  • 16
  • 45
  • 62

1 Answers1

1

You want it to remain FK_Employee_Departmemt_Status? You should really read something about naming conventions in .NET. Never mind as I know you cannot change this behavior and you must modify names manually after updating from database. Moreover in this case you have a big change you will have to do it after each update of the entity containing that FK.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
  • Actually renaming a Navigation property persists across updates. I have done it: http://stackoverflow.com/questions/6203308/navigation-properties-on-join-tables-in-entity-framework – Neil N Sep 28 '11 at 14:25
  • @Neil: It persists across "some" updates but not across all. I saw that in my own project and many other developers report the same issue. Sometime designer decides to rename silently property back to `XXX1` – Ladislav Mrnka Sep 28 '11 at 14:38