Is a bug for EF MigrateDatabaseToLatestVersion?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
zipiii
Posts: 6
Joined: Sat 20 Feb 2016 16:37

Is a bug for EF MigrateDatabaseToLatestVersion?

Post by zipiii » Wed 31 May 2017 07:25

Hi

I am trying to implement dotConnect for Oracle and EF MigrateDatabaseToLatestVersion.

I am using EF6, Oracle 11g and dotConnect for Oracle 9.2.187.

When using MigrateDatabaseToLatestVersion, every program runtime execution method of Configuration.Seed(), resulting in repeated insert data.

I am attaching simple project where the situation can be replayed.
http://pan.baidu.com/s/1hrK2I9Y
or
https://github.com/zipiii/MyDevart.EF6.Test

To run the project please modify connection string, create oracle db, create schema abp1 and run Update-Database migration command and run it.

Please help me!
My customer username is light.way@gmail.com.

thx!

Shalex
Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Re: Is a bug for EF MigrateDatabaseToLatestVersion?

Post by Shalex » Fri 02 Jun 2017 14:18

When using MigrateDatabaseToLatestVersion, every program runtime execution method of Configuration.Seed(), resulting in repeated insert data.
Please use

Code: Select all

context.Products.AddOrUpdate(...);
instead of

Code: Select all

context.Products.Add(...);
to avoid repeated inserts. We have just sent a test project to your email.

Post Reply