Author : MD TAREQ HASSAN
EF core SQL Server
Install-Package Microsoft.EntityFrameworkCore.SqlServer
appsettings
appsettings.json
is available as DI service for ASP.Net core- for other applications, you have to create
appsettings.json
file and install packages
Install-Package Microsoft.Extensions.Configuration.Json
# will install all required dependencies accordingly
EF Core Tools
Install-Package Microsoft.EntityFrameworkCore.Tools
Update-Package Microsoft.EntityFrameworkCore.Tools
Get-Help about_EntityFrameworkCore
- Using Tools: https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/powershell#using-the-tools
- Startup project : must be core or full .net (beacuse EF tools uses runtime of startup project to execute EF Design Logic)
- Target project: project to which EF model should be generated + Migration
- Database first scaffolding:
Scaffold-Dbcontext "conn-string"