Skip to main content
.NET Standard 2.0+

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.


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