Entity Framework 6 with Oracle Code First Design Configuration

Microsoft Entity Framework abstracts the relational, logical database schema and presents a conceptual schema to the .NET application. It provides object-relational mapping for .NET developers. Code First allows developers to create .NET classes, which in turn can be persisted as database objects. Code First Migrations allows developers to evolve the code-based model so that changes are accurately reflected in the persistent database store.

Starting with Oracle Data Access Components (ODAC) 12c Release 3 (12.1.0.2.1), ODP.NET supports Code First and Code First Migrations from Entity Framework 6. ODP.NET provides the data access to store the EF model inside the Oracle Database and evolve it.

 

Install following items from Nuget Package:

  • EntityFramework
  • Oracle.ManagedDataAccess
  • Oracle.ManagedDataAccess.EntityFramework

 

Set configuration on app.config or web.config

  1. connection descriptor needs to be in data source section in <oracle.manageddataaccess.client> tag.
  2. data source in connection string must be specified in <dataSources> tag with alias.

Leave a Reply