Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to update Entity Data Model and Model Classes automatically in Asp.net MVC

How to update Entity Data Model and Model Classes automatically in Asp.net MVC

I am trying to develop ASP.NET MVC 5 Application with VS 2015
I follow the database first approach. If I added a new column to the database table how to config my Entity Data Model and model classes to be updated automatically?

Solution:

Remember to back your project up first before you try below methods first time

1. Open your Model Browser by double-clicking your .edmx file.
Right click on the Model Diagram ==> select Update Model from Database... ==>
Choose the Refresh tab in the Update Wizard that opens and click Finish button.

2. You have to delete that existing table in edmx ==> right click on edmx ==> select update model option ==> the table which you updated in db before that you have to delete that table in edmx. Like this only we have to add the updated table in edmx. 

Users Please post your solution too.


This post first appeared on Asp.netSourceCodes, please read the originial post: here

Share the post

How to update Entity Data Model and Model Classes automatically in Asp.net MVC

×

Subscribe to Asp.netsourcecodes

Get updates delivered right to your inbox!

Thank you for your subscription

×