Is a bug for EF MigrateDatabaseToLatestVersion?

Is a bug for EF MigrateDatabaseToLatestVersion?

Postby 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!
zipiii
 
Posts: 6
Joined: Sat 20 Feb 2016 16:37

Re: Is a bug for EF MigrateDatabaseToLatestVersion?

Postby 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.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle