Hi,
Code First:
* Code First is especially popular in the early stages of a brand new project (the so-called “green field” scenario)
* Ideally you don’t have to be concerned with existing data and schemas; you are working with test data and are free to create and destroy databases at will.
* You don’t create or update database schemas in the early phase of the project. You let the Entity Framework create (and recreate) the database for you.
* You just work with the small, simple entity classes that you wrote yourself, changing them as you go, unencumbered by external tools, XML files, or databases. It’s fast, it’s clean, and it’s transparent.
* Entity class simplicity is another advantage of Code First. In Code First you always write the class yourself. Your class has only the code that you decide is necessary and appropriate. You write the class members in the style you prefer and in the order that makes sense to you.
DataBase First:
* Database First is popular in so-called “brown field” scenarios with developers who build applications that access existing production databases holding large numbers of tables and columns.
* You will let EF create entities for you and after modification of mapping you will generate POCO entities.
* Database First shines when managing a large, complex database schema with numerous unconventional mapping requirements … but you’re a prisoner of the EDMX and the EDM Designer. Code First shines when you’re making lots of small changes iteratively to a model that aligns well with your database.
Model First:
* In the Model First approach, the database model is created first using the ORM designer in Visual Studio.
* Once the model consisting of entities and relationships has been designed, the physical database will be generated from the model.
* It gives you the flexibility to delay the creation of the database. You can design the structure independently, and see different possibilities of improving it. Later you can generate the physical structure. Good for new systems or new capabilities in existing systems.
Mark as answer if satisfied.........
Thank You,
Kavya Shree M.
Kavya Shree Mandapalli
balajirnaukri-12656, if this helps please login to Mark As Answer. | Alert Moderator