Code First Entity Framework Core

Most of the people worked with Entity Framework are familiar with the approach of generating databases through code is popularly known as the "Code First" approach. "Code First" workflow begins with classes that describe the conceptual model.  Code first approach offers the most control over the final appearance of the application code and the resulting database.  The following are the few advantages of this approach.

Advantages:

  • Database Version Control
    • Versioning databases is hard, but with code first and code first migrations, it’s much more effective
    • Because the database schema is fully based on code models, by version controlling source code you're helping to version your database
  • Speed up Development
    • No dependency between developers
    • Easy to onboard new developer
    • Each developer will have their own Database
    • Much easier and quicker to add a property to a class in the code than it is to add a column to a table
    • Full control over database design without much knowledge of SQL and DBA
    • Out of the box support from Visual Studio and TFS/VSTS to merge code with other developers
  • More support for DevOps
    • Doesn’t require a separate resource to manage DB
    • Easy to generate Create, Update and Delete scripts
    • More support for test data and Unit testing


UPDATE - July 11 2019 - Please refer the following link for the more updated version of Code First Entity Framework Core post with the sample project

https://www.blogofpi.com/code-first-entity-framework-core/


1 Comment

Comments have been disabled for this content.