EF Core 3.0: duplicate insert with huge amount of data

.net-core c# entity-framework-core

Accepted Answer

ZZZ_tmp
0
10/18/2019 9:33:26 AM

Popular Answer

I believe the issue is thatDistinct() does not function as you would expect.

I think there are "duplicates" in the original table with different ids.

I advise usingGroupBy in place ofDistinct :

context1.Transactions
    .GroupBy( x => 
       new { x.PersonID,
             x.TranDate,
             x.CreatedBy} )
     .Select( g=> g.First());


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow