ASP.NET MVC + Entity - Mapping New Tables

1

Good morning,

I have a project using ASP.MVC + EF and I mapped about 20 tables using the VS wizard (creating ADO.NET Entity Data Model , selecting the database and tables I want), but now I have 16 more tables to insert into the system and I do not find an option to include them using automatic mapping (as in the first 20).

From what I've seen, some people report deleting my class that has DbContext (created from the ADO.NET Entity Data Model wizard) and recreates it, but I'm not sure if this is the ideal way, since models are already formatted with Data Annotations and are used in various controllers.

Is there any way to map new tables using the wizard of Entity Data Model without having to delete the DBContext created in the first mapping?

I'm using Visual Studio Community 2017 and Code First from DataBase mode.     

asked by anonymous 23.08.2017 / 14:33

1 answer

0

You can open the designer by right-clicking on your .EDMX file and selecting Open With - > ADO.NET Entity Data Model Designer Right-clickthedesignersurfaceofthe.EDMXdesigner,andclickUpdateModelFromDatabase. All entities are updated by default, new entities are only added if you select them.

    
24.08.2017 / 13:50