I am mapping my database using Entity Framework, using the database-first approach.
The problem is that the edmx
file that should be mapping my exact database is missing some FK relations between the tables, which causes me to change my queries, because I can't approach the related tables directly.
Of course changing it directly in the classes code, it's erased every time I change something in the database (the edmx
is recreated).
I need help please!!!
When you create the model from the database, there is a checkbox marked "Include Foriegn Key columns In The Model" - Make sure this is checked.
See this article for more info.