Skip to main content

Visual Studio - Entity Framework Tips

dotnet tool install --global dotnet-ef
dotnet ef migrations add CreateInitial
dotnet ef database update
//https://www.youtube.com/watch?v=Fbf_ua2t6v4

Scaffold

dotnet ef dbcontext scaffold "Data Source=mfb-us-sql-001;Initial Catalog=MyFFLBookAPI;TrustServerCertificate=True;User Id=XXXXXX;Password=XXXXXX" Microsoft.EntityFrameworkCore.SqlServer -c DataContext --context-dir Data -o Data -f

Redo

https://stackoverflow.com/questions/36741793/ef-7-migration-to-existing-database