Choose the Work Flow for Entity 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—
- Create model in designer.
- Generate DB from the model.
- Classes that are going to interact auto generated from model.
Database First—
- Reverse engineer model in designer.
- Classes are auto-generated from Model.
Code First (New Database) —
- 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.
- Database is created from the model.
- If I can my model, then can use the Code First Model to evolve database.
Code First (Existing Database) —
- Define classes and mapping in code.
- Reverse engineering tools are available.