1

I was wondering... since there is no EDMX in EF Core, what is the difference between those 2? And if the major difference would be the possibility to change the database tables, why not use code first then use EF code-first migrations?

shade1337
  • 83
  • 1
  • 2
  • 9
  • Possible duplicate of [Code-first vs Model/Database-first](https://stackoverflow.com/questions/5446316/code-first-vs-model-database-first) – Jan Paolo Go Jun 08 '19 at 15:05
  • EF Core does not support EDMX (aka EF6 Model-First). EF6 and EF Core's Code-First and Database-First are the same concept. – Jan Paolo Go Jun 08 '19 at 15:08

1 Answers1

2

Database-First

DB-First is that you reverse engineer an existing database to create an Entity Framework model.Instead of designing the EDMX manually and generating the SQL script to create the Database, we build the latter and then generate the former using the Entity Framework Designer tool.

Code-First

Code-First uses migrations to create the database from the data model you define.

However, as long as we’re dealing with a rather small project – for example, a microservice – and/or we’re aiming for a flexible, mutable small-scale data structure, adopting the Code-First approach will almost always be a good choice.

Ryan
  • 19,118
  • 10
  • 37
  • 53
  • We were building a team project, and I did database-first approach, but my project deleted this and let me start over with code-first migrations. Was it a right decision? – muhammad tayyab Jun 26 '23 at 00:48