Skip to main content
All docs
V21.2
.NET Framework 4.5.2+

Use Entity Framework 6 with an Existing Database

With Entity Framework 6 (EF 6), you can generate the business model from an existing database instead of creating it from scratch. To learn more about the Database First approach in EF 6, refer to the following tutorials.

Depending on the Visual Studio version and the code generation strategy, the entity model can be created within the DbContext or ObjectContext entity container. Refer to the Use the Entity Framework 6 Data Model topic to learn how to use these containers in XAF.

Note

In the Entity Data Model Wizard it is recommended to leave the Pluralize or singularize generated object names option checked by default when adding or updating data model from an existing database. This way identification of primary and foreign key properties will be automatic according to the default naming conventions.

See Also