Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Database First - Foreign Keys Not Showing up as Navigation Properties

$
0
0

Coding an MVC asp.net web application with an existing database (db first).  

My existing database has table tbluser with a foreign key idworker refrencing table tblworker primary key id.

With the models folder selected, I add new item, Data, ADO.net Entity model, connect to my database and choose the 2 tables :

tbluser and tblworker

I make sure that Include foreign key columns in model option is selected.

But the navigation properties are not added.  The model class for tblwork doesnt have a tbluser property of type tbluser.  

Very new to MVC entity framework The tutorials I ran through movies and ContosoUniversity one are so cool.  I have a lot of tables in this legacy database with foreign keys and would love to see foreign key columns included in my models. Any suggestion is appreciated.


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>