IntroductionIn the Code First approach, the focus can be on the domain design and creating classes as in the domain requirements rather than designing the database first and then creating the classes that match the database design. Code First APIs create the database on the fly based on the entity classes and configuration.BackgroundSo, being a developer I guess the Code First approach would be a fine approach rather than focusing on creating databases.Using the code
First create classes as required for the Domain (Domain Driven Design).
Create a Context Class derived from the DbContext class present in the using System.Entity namespace.In the DbContext class we add the DbSet<T> of the classes.And then creating a Console Application with the following code as (just a snippet for reference):
Points of Interest
In the console application use Entity Framework Reverse Engineering to generate the DbContext classes for the domain classes created.And in the MVC application we use Migrations in the Package Manager Console. (Enable-Migrations/Update-Database Verbose).