ABP Framework EF6 link Oracle Database Manual migration

Source: Internet
Author: User
Tags error handling

Environment: VS2017 + ABP official template (excluding zero) +oracle 11gx64db + Oracle 11gx32client (plsql tool access)

I. Download and operation of ABP project

1. Create an ABP project. Go to the official website https://aspnetboilerplate.com/download the project template. The ABP project has two architectures, one single page (ANGULARJS) and the other MVC. Click the Create button. Into:

2, the download of the source code first to compile, let it automatically download NuGet project dependency package, to ensure that the source code can be compiled through.

3. Add the User.cs class to the Winrun2.core project:

Add several properties to the user entity as follows:

3. Modify the Winrun2dbcontext class in the Winrun2.entityframework project:

Add Dbset<user>:

Increase the schema of the Oracle database (the default is that the Dbo,oracle database must be modified):

Second, Oracle DB support for EF code First

1. Add Oracle EF-driven references in the Winrun2.entityframework project to install in NuGet:

2. Modify the Web. config configuration information in the Winrun2.web project (you can also install the oracle.manageddataaccess dependency package in the Winrun2.web and automatically generate the Oracle configuration information in config)

Iii. Creating an Oracle database schema

1, first to ensure that the local client can link to the Oracle DB Server, with DBA authority account using the Oracle development tools or Sqlplus to create new schema information:

2, login Cps/[email protected] To test, query all table:

3. Configure the Oracle link string in Web. config:

TNS Configuration:

Link String configuration:

IV. Realization of data migration

1, Add-migration:

2, Update-database, here Error:

3. Error handling due to non-existent or inconsistent version in Odp.net GAC (Global Assembly Cache).

Installing Oracle.ManagedDataAccess.dll to GAC resolved my issue. IF you installed Oracle Client or Oracle Database on your machine this might be the cause.

Note the path, the different system version (WIN10) paths will not be the same: "C:\Program Files (x86) \microsoft Sdks\windows\v10.0a\bin\netfx 4.6.1 Tools\gacutil.exe"/ I Oracle.ManagedDataAccess.dll

4, again update-database, or error, but changed a mistake:

4. This error indicates that the Oracle driver is OK, the link login times is wrong and the problem is resolved again:

Add persist Security Info=true in the link string.

5, re-migration, success!

6. Changes to Oracle Database

Migration supports self-growing types (Oracle uses Trigger+sequences to implement self-growing IDs)

Reference Links:

Http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/CodeFirst/index.html#overview

Http://www.cnblogs.com/freeliver54/p/6951700.html

Http://www.cnblogs.com/yuanbeier/articles/6420621.html

http://blog.csdn.net/yangxuilyx/article/details/52561874

Https://stackoverflow.com/questions/32006884/entity-framework-seed-method-exception

Http://www.cnblogs.com/haight/p/5600756.html

ABP Framework EF6 link Oracle Database Manual migration

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.