In entity framework 4 ,Code first is one of the interesting tool introduced by microsoft. Code first is the latest addition in entity frame-work 4. The following is the diagram which show different options available for modeling with entity framework :
We can either use Code first, Database First and Model first these are just a way for building an entity data model that can be used with entity framework to performing data access. We can either choose to go with a designer or code based modeling depending upon the requirements, the entity framework runtime behaves the same. In the figure, if we use Model first then we will create .edmx model first and from this model EF will generate the database and the classes will be automatically generate from this. When we use Database First, we create a database first and then let EF generator the classes and .edmx model. Code First can be done in two ways, first, we do reverse engineering we begin with the coding the classes and then let EF create a database for us according to the classes. Second, If the database already exists we can code the classes and map the classes to database table to work with EF.
Source: Programming Entity Framework: Code First
