What is the difference between EF Core Database-First and EF Core Code-First approaches?

asp.net-core ef-code-first ef-database-first entity-framework-core

Question

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?

1
0
6/8/2019 5:04:14 AM

Popular Answer

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.

0
6/11/2019 7:29:08 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow