Code First Fluent API
Code First is a new development methodology available beginning with the Entity Framework 4.1. When using Code First development you usually begin by writing .NET Framework classes that define your conceptual (domain) model. The classes do not need to derive from any base classes or implement any interfaces.
After your classes are defined you can optionally specify additional mapping configuration that will override the default Code First conventions. A mapping configuration can be used to map to an existing database schema or to affect the shape of a generated schema. You can override conventions using Code First Data Annotations or the fluent API. The fluent API overrides data annotation.
The fluent API is exposed through the DbModelBuilder type and is most commonly accessed by overriding the OnModelCreating method on DbContext. The topics in this section demonstrate how to use the fluent API to configure your model.
In This Section
Build Date: