ABP Connects to Oracle database

Source: Internet
Author: User
Tags connectionstrings

1.**entityframework Add Oracle EF-related NuGet package Oracle.ManagedDataAccess.EntityFramework (Auto add oracle.manageddataaccess)

2.**web Add Oracle.ManagedDataAccess.EntityFramework (Auto add oracle.manageddataaccess)

Overriding onmodelcreating methods under 3.**entityframework

protected Override void onmodelcreating (Dbmodelbuilder modelBuilder)        {            Modelbuilder.hasdefaultschema ("ORCL"); // be sure to capitalize            Base . Onmodelcreating (ModelBuilder);        }

4. Modify the Web. config under **web

<oracle.manageddataaccess.client>    <version Number="*">      <datasources>        <DataSourcealias= "ORCL"Descriptor= "(Description= (address= (protocol=tcp) (Host=localhost) (port=1521)) (Connect_data= (SERVICE_NAME=ORCL)))"  />      </datasources>    </version>  </oracle.manageddataaccess.client>
< connectionStrings >       <  name= "Default"  providerName= "Oracle.ManagedDataAccess.Client"  connectionString= "User id=orcl; Password=orcl;data SOURCE=ORCL; Persist Security info=true "/>  </connectionStrings> 

5. Package Management Console

5.1 Default Project Options Select **entityframework

5.2 Execute add-migration command

5.3 Execute update-database command

Note: encountered a pit, did not do the above steps, executed the NuGet command, resulting in the generation of Sqlerver resource files, so has been reported no dbo user error

ABP Connects to Oracle database

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.