Configuration of Oracle and Entity Framework 6, Documentation

Source: Internet
Author: User
Tags oracle developer

Official Document: Http://docs.oracle.com/cd/E56485_01/win.121/e55744/intro001.htm#ODPNT123

Oracle's support for Microsoft Entity Framework EF6 is implemented in a new version of Odp.net.

Oracle Data Access Components (ODAC) Windows Downloads:ODAC 12c Release 3Includes support for Entity Framework 6 code First and code first migrations;NuGet Package, the. NET Framework 4.5.2; and Odp.net, Managed Driver XML DB.

Http://www.oracle.com/technetwork/topics/dotnet/downloads/index.html

Practice many times to successfully establish an entity DataSet: Must be installed after the VS2013 UPDATE4 installation is complete

1) 32-bit Odac with Oracle Developer Tools for Visual Studio Downloads

2) After establishing the VS solution, install the ORACLE NuGet package (two packages). ---through the package Manager.

This will create some configuration information in the solution's project configuration file, app. Config, or Web. config!!!

<section name= "oracle.manageddataaccess.client" type= "OracleInternal.Common.ODPMSectionHandler, Oracle.manageddataaccess, version=4.121.2.0, culture=neutral, publickeytoken=89b483f429c47342 "/>

<provider invariantname= "Oracle.ManagedDataAccess.Client" type= " Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, version=6.121.2.0, culture=neutral, publickeytoken=89b483f429c47342 "/>

By completing these two steps, you can add: ADO. NET Entity Data Model to reference the ORACLE database.

Depending on whether the EF designer or code first codes are preferred, a connection string is generated in app. Config or Web. config

<add name= "cdentities" providername= "System.Data.EntityClient" connectionstring= "metadata=res://*/ Model.cddbmodel.csdl|res://*/model.cddbmodel.ssdl|res://*/model.cddbmodel.msl;provider= Oracle.manageddataaccess.client;provider connection String=&quot;data Source=192.168.100.18:1521/gdaa; PASSWORD=GDAA; PERSIST SECURITY info=true; USER id=gdcd&quot; "/>

<add name= "Hpmodel" providername= "Oracle.ManagedDataAccess.Client" connectionstring= "DATA source= 192.168.100.18:1521/GDAA; PASSWORD=GDAA; PERSIST SECURITY info=true; USER Id=gdaa "/></connectionstrings>

The special question is : if it is ASPNET MVC, the database model as a separate: DLL Class Library project, VC as an MVC project, the creation process has certain requirements:

1) First create the DLL Class Library project solution, add ORACLE's dedicated NuGet package, and then add: ADO Entity Data model;

2) Create an ASPNET MVC solution to add ORACLE's dedicated NuGet package;

3) Bring the project of the data model scenario into the MVC scenario, and copy the APP for the data model scenario. Config in the link connection string <add name= "XXXXX" ..., added to the MVC scheme's web. config.

The main reason is that when the data model context DBCONTEXT is instantiated in the MVC code, the Get link connection string must be the current schema's configuration file.

Configuration of Oracle and Entity Framework 6, Documentation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.