Register now or log in to join your professional community.
Code first
Database first
Model first
There is no difference in functionalities, both generate databases and control the database version, but depending on the developer 's way of coding, if he prefers visual then he might find working with model first easier, if he prefers object oriented way, then code first is the best choice.In my case, I prefer the code first since I have full control over the code ( no auto-generated code like Model first), more powerful in case of adding polymorphism and inheritance... the object oriented programming ideas.
Code First:
write code and creat databse on the fly when the app run
Model First:
buld data base first before write code
Code First:
Well as it's already being depicted from the name that we first code according to which relationships and data model is generated.
Model FIrst:
Whereas in this approach we have to import the model according to which the classes are generated automatically.
Both of them used when you don't have Database,
code first you will start write your own class and mapping between them then the database created based on that classes and when you run the application the entity framework will create the database for you, in other wise the model first you will create the edmx model inside the designer then you will export the script then you have to go to the database to run the script.