create model in BD using CodeFirst approach

0

Product of a problem with the database, when making an update, the definitions of the tables were lost.

As I still have the model in the application (context and entities), it occurred to me, using the CodeFirst approach with this model, but this is not recreated in the database.

I have tried using the context by reading the entities, or creating them, but even so, the created entities are not refreshed in the database.

Is there an alternative to recreate the model in the BD, from .net?

Greetings

    
asked by Luis Gabriel Fabres 30.03.2017 в 03:40
source

1 answer

0

If you have a model edmx use the option Generate Database from Model of the image

to generate a script that creates the database based on the model

    
answered by 03.04.2017 в 16:20