Install-Package Microsoft.EntityFrameworkCore.SqlServer
Install-Package Microsoft.EntityFrameworkCore.Tools
Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design
Then, to create the models or database context of the existing database to a folder named Models, you can use the following command:
Scaffold-DbContext
“Server=Your_Server_Name;Database=SampleDb;Trusted_Connection=True;”
Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
This command will generate a DbContext and POCO of SampleDb from Your_Server_Name database to Models folder.
No comments:
Post a Comment