Well I'm using Visual Studio 2017, I have a project in C # which has installed Entity Framework in version 6.2.0 in addition to using SQL Server 2008. (I'm not using MVC but Web API)
What I need is to be able to map my database model in the Visual Studio project to my database in SQL Server, although entity framework allows me to map it with the option in the entity viewer called "Generate base of data from model ... "this deletes all database records in SQL Server, to which I need the data already registered not to be deleted.
Is there any way to do this? I tried it with "Code First Migrations" but when I made the Enable-Migrations I got this error:
Creating a DbModelBuilder or writing the EDMX from a DbContext created using Database First or Model First is not supported. EDMX can only be obtained from a First Code DbContext created without using an existing DbCompiledModel.
However, if you create the Migrations folder and execute the command
add-migration InitialCreate
marks me the previous error "Creating a DbModelBuilder ..."
and no class is generated with the changes that have been made in the model.
It should be noted that the entities generated by the Entity Framework of the Database are in a separate project called Entities.