Entity Framework with Oracle databases

9

I'm creating an application that will use an Oracle database, but when I enter .edmx (Entity Data Model) I came across the following situation!

I can not create a connection with Oracle Database. What do I need to do to make this work? Do I have to install a driver? Or is it not possible to work with entity framework and Oracle databases?

    
asked by anonymous 10.04.2014 / 15:38

2 answers

7

Yes, ODP.NET:

link

Here are some more information:

link

At the moment of this response, the Entity Framework does not work well with Oracle, but you can write your own Repository with the database operations and make a override of its context to behave like a native Entity Framework.

I have a project that works like this. If you want to go this way, please ask more questions that I will post examples of code you can work on.

EDIT

I had said that Oracle does not work with Entity Framework, but this response has become outdated, so I'm updating.

First you need to install the NuGet package Oracle.ManagedDataAccess.EntityFramework . The configuration of Web.config should look like this:

  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </providers>
  </entityFramework>

You must also define a connection string for Oracle to work correctly.

Once you have done this, just work normally with the Entity Framework that should work.

    
10.04.2014 / 15:43
1

Here are all Ado .Net Data providers for the various databases. Some of these drivers do not work correctly, but the paid ones do work. So just to confirm that depending on the database and depending on the version of the database does not accompany the development and improvement of the ORM Entity Framework.

    
10.04.2014 / 15:55