Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework 6 not updating from database correctly in VS 2019

I'm working on a .NET MVC web app using Entity Framework 6 to manage a model from a SQL Server database. I've been using VS 2017 to develop everything so far, making changes to the database, and updating the model after those changes are made. When I switched to VS 2019 and attempted this, only the model and diagram of the model were updated. The classes generated by EF were not updated with the changes from the database. Does VS 2019 handle EF models differently than 2017?

like image 723
jbrown7061 Avatar asked Apr 05 '19 15:04

jbrown7061


People also ask

How do I update EDMX VS 2019?

In the Model Browser, right-click the . edmx file and select Update Model from Database. Expand the Tables, Views, and Stored Procedures nodes, and check the objects you want to add to the . edmx file.

Is Entity Framework 6 still supported?

Versions 6.0, 6.1, 6.2, and 6.3 are no longer supported. Although Entity Framework 6. x is still supported, it is no longer being developed and will only receive fixes for security issues.


Video Answer


1 Answers

According to this thread on VS Developer Community, it will be fixed in VB2019.1, in the meantime there's a workaround:

  1. Save the .edmx file
  2. Expand the .edmx file in Solution Explorer
  3. For each .tt files inside it, right-click and choose Run Custom Tool.
like image 194
Guillaume Filion Avatar answered Oct 23 '22 23:10

Guillaume Filion