Dreteh
Dreteh

Reputation: 387

Navigation Properties get overwritten when I update my Entity framework from database

I have a table called Matches and a table called Teams in my database where my Matches table has two foreign key HomeTeamID and AwayTeamID link to Teams table.

When I generate edmx file I got Team and Team1 in my Navigation Properties in my Matches class. I overwrote them to HomeTeam and AwayTeam in the design panel, and everything works fine.

But next time when I update my model from database, their names changed back to Team and Team1.

How can I solve this? Thank you in advance =)

Upvotes: 0

Views: 131

Answers (1)

Craig Stuntz
Craig Stuntz

Reputation: 126567

Add real foreign keys to your DB.

Upvotes: 0

Related Questions