EF Code-First is a way of using Microsoft's Entity Framework with POCO classes, as opposed to model-first or DB-first.
Entity Framework Code-First is a methodology for providing mapping between .NET CLR classes and database structure. Classes and properties may be marked up with attribute decorators (for example [Table("MyTable")]
or [Column("CreatedDate")]
) or the description for mapping the classes and their properties may be made through the FluentAPI method calls overriding the model creation.
Code-first also operates by convention in that with no markup or FluentAPI coding, it will attempt to connect to a default SQLServer instance to a database named for the project that contains the DBContext class (for example if creating a FoodPantryDAL project where your context will be created, it will attempt to connect to ./SQLExpress/FoodPantryDAL). If the database is not there (and the SQLServer instance is) it will generate the database according to the classes and properties that are currently defined. Tables will be named after the classes they represent, properties also. Properties named ID or [ClassName]ID will be created as a primary key. Classes which reference other classes will be given foreign key relations to those classes, etc.
Code-First may be used not only to create a new database but can all create a mapping to an existing database structure.