Choose the Work Flow for Entity Framework

framework

Two things are therein mind while choosing the workflow.

Things that are outside our control:

New database/Existing Database:

Thing that are inside our control:

Creating model using design or writing code.

Model First—

  1. Create model in designer.
  2. Generate DB from the model.
  3. Classes that are going to interact auto generated from model.

Database First—

  1. Reverse engineer model in designer.
  2. Classes are auto-generated from Model.

Code First (New Database) —

  1. Find my model in code. Model is made up of main classes that are going to interact with the application. Optionally can provide the code for mapping and configuration.
  2. Database is created from the model.
  3. If I can my model, then can use the Code First Model to evolve database.

Code First (Existing Database) —

  1. Define classes and mapping in code.
  2. Reverse engineering tools are available.

About the Author

Neha Saini

Neha Saini

Related Posts

X