Monday, January 12, 2015

Entity Framework: Usage Patterns

Database First

  • Use EF Designer to reverse engineer a database into a model (code classes).
  • Use the Designer to keep the model in sync with the database.
  • Visually change mapping, and other properties

Model First

  • Start with a blank model in the Entity Framework Designer
  • Build out the model and generate the POCO classes and database from generated code

Code First

  • Start coding your own classes. (Or to expedite use Entity Framework Power Tools to generate classes from an existing db.)
  • Db scripts can be generated from these classes with EF tools

Code and Database Separate