MS SQL Database Scaffolding with Entity Framework Core
APACHE-2.0 License
This is a project for Scaffolding DBContext in Entity Framework Core from existing MS SQL database.
NuGet Packages | Version |
---|---|
Microsoft.EntityFrameworkCore | 5.0.2 |
Microsoft.EntityFrameworkCore.SqlServer | 5.0.2 |
Microsoft.EntityFrameworkCore.Tools | 5.0.2 |
It's very simple. It's a C# class library targeting .net core 3.1. So makesure you have .net core 3.1 selected as target framework.
Step # 1 :
Clone the repository
Step # 2 :
Select Windows Authentication from SSMS (SQL Server Management Studio)
Step # 3 :
Open the solution file with Visual Studio 2019
Step # 4 :
Go to ***Tools > NuGet package manger > Package Manager Console***
Step # 5 :
Run the following Command
Scaffold-DbContext "User Id=[Your User Id];Database=[Database Name];TrustServerCertificate=True;Encrypt=False;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entities
N.B: In case yout are not using windows authentication, use the following command
Scaffold-DbContext "User Id=[Your User Id];Password=[Your Password];Database=[Database Name];TrustServerCertificate=True;Encrypt=False;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entities
MIT
Free Software, Hell Yeah!
Tools I used to create this read me. Might also help you!