Note: Run powershell commands where DbContext lives (Samurai.Data
)
Add-Migration initial
script-migration
add-migration relationships
update-database
scaffold-dbcontext -provider Microsoft.EntityFrameworkCore.SqlServer -connection "ConStr"
`
get-help entityframeworkcore
Note: Run powershell commands where DbContext lives (Samurai.Data
)
Nugetget pkg: Microsoft.Extensions.Logging.Console
optionsBuilder
.UseLoggerFactory(MyConsoleLoggerFactory) //set logging factory
.EnableSensitiveDataLogging(true) //view parameter values in the console logs
- Microsoft.EntityFrameworkCore.SqlServer v2.0.1
- Microsoft.EntityFrameworkCore.Tools v2.0.1
- Microsoft.EntityFrameworkCore.Design v2.0.1
- Microsoft.Extensions.Logging.Console v2.0.0