Home > Mobile >  ASP.NET MVC / Entity Framework - Controller generation is somehow using old properties
ASP.NET MVC / Entity Framework - Controller generation is somehow using old properties

Time:05-05

After adding and altering columns in the SQL database, I've refreshed the Entity Model (Entity Framework 6) and deleted all controllers and views, to generate them again according to the refreshed entity model.

Somehow the newly generated controllers and views are still based on the "old version" of the entity model. The newly added columns of the tables are not included. All models from Entity Framework are looking ok and updated.

I've already tried to delete the whole entity model and recreate it again without any luck. The controllers and views will show errors for all altered columns, of course because the column names are not correct anymore.

Is it possible that the old entity model is cached somehow in Visual Studio? Or why does this happen and how can it be fixed?

CodePudding user response:

To fix it you have to rebuild the project in Visual Studio.

  • Related