1- #if NET8_0
1+ #if NET8_0_OR_GREATER
22using Medallion . Collections ; // uses StrongNamer nuget to sign ref. with Strong Name
33#endif
44using Microsoft . EntityFrameworkCore ;
@@ -62,7 +62,7 @@ private static async Task SaveChangesAsync(DbContext context, BulkConfig? bulkCo
6262 // Topologically sort insert operations by FK
6363 var added = entriesGroupedByEntity . Where ( x => x . State == EntityState . Added ) ;
6464 var addedLookup = added . ToLookup ( x => x . EntityType ) ;
65- #if NET8_0
65+ #if NET8_0_OR_GREATER
6666 var sortedAdded = added . OrderTopologicallyBy ( g => getFks ( g . EntityType ) . SelectMany ( x => addedLookup [ x ] ) ) ;
6767#else
6868 var sortedAdded = added ;
@@ -71,7 +71,7 @@ private static async Task SaveChangesAsync(DbContext context, BulkConfig? bulkCo
7171 // Topologically sort delete operations by reverse FK
7272 var deleted = entriesGroupedByEntity . Where ( x => x . State == EntityState . Deleted ) ;
7373 var deletedLookup = deleted . ToLookup ( x => x . EntityType ) ;
74- #if NET8_0
74+ #if NET8_0_OR_GREATER
7575 var sortedDeleted = deleted . OrderTopologicallyBy ( g => getFks ( g . EntityType ) . SelectMany ( x => deletedLookup [ x ] ) ) . Reverse ( ) ;
7676#else
7777 var sortedDeleted = deleted ;
@@ -265,7 +265,7 @@ private static async Task InvokeBulkMethod(DbContext context, List<object> entit
265265 { EntityState . Modified , new KeyValuePair < string , int > ( nameof ( DbContextBulkExtensions . BulkUpdate ) , 2 ) } ,
266266 { EntityState . Added , new KeyValuePair < string , int > ( nameof ( DbContextBulkExtensions . BulkInsert ) , 3 ) } ,
267267 } ;
268- #endregion
268+ #endregion
269269
270270 private static List < BulkMethodEntries > GetBulkMethodEntries ( IEnumerable < EntityEntry > entries )
271271 {
0 commit comments