0

Is there a way to use Entity Framework Core, but create all tables in the database manually with SQL scripts?

starball
  • 20,030
  • 7
  • 43
  • 238
Teamol
  • 733
  • 1
  • 14
  • 42
  • Sure - I use [DbUp](http://dbup.github.io/) to run the SQL scripts, and the excellent [EF Core Power Tools](https://marketplace.visualstudio.com/items?itemName=ErikEJ.EFCorePowerTools) to reverse-engineer the created database into EF Core model classes. – marc_s Mar 14 '21 at 13:14
  • Yes - you can create and configure your models manually and configure it in your DbContext https://learn.microsoft.com/en-us/ef/core/modeling/ . Also see here on how to run SQL scripts: https://stackoverflow.com/questions/650098/how-to-execute-an-sql-script-file-using-c-sharp – James Lieu Mar 15 '21 at 13:02

0 Answers0