Adding Object to EF Model Does Not Display Object

Leave a comment

When using the Entity Framework, such as in an ASP.NET MVC application, you may find the model is empty after choosing database objects:

Adding new objects using “Add existing entities and relationships to this diagram by dragging them from the Model Browser” does not add the objects.

One cause for this is that a primary key has not been defined in the table or view you are trying to use in the model.

To resolve this, add a primary key to your table. Then, update the model:

Reselect the table/view and you will see it in your model.

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

Leave a Reply

Your email address will not be published. Required fields are marked *