File tree Expand file tree Collapse file tree
src/PhenX.EntityFrameworkCore.BulkInsert/Graph Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ private async Task InsertJoinRecordsAsync(
300300 }
301301
302302 // Check if the join entity is a dictionary (shared-type entity)
303- var isDictionary = joinEntry is IDictionary < string , object > ;
303+ var dictEntry = joinEntry as IDictionary < string , object > ;
304304
305305 // Set FK values for left entity
306306 for ( var i = 0 ; i < fk . Properties . Count ; i ++ )
@@ -309,9 +309,9 @@ private async Task InsertJoinRecordsAsync(
309309 var pkProp = fk . PrincipalKey . Properties [ i ] ;
310310
311311 var pkValue = GetPropertyValue ( record . LeftEntity , pkProp . Name ) ;
312- if ( isDictionary )
312+ if ( dictEntry != null )
313313 {
314- ( ( IDictionary < string , object > ) joinEntry ) [ fkProp . Name ] = pkValue ! ;
314+ dictEntry [ fkProp . Name ] = pkValue ! ;
315315 }
316316 else
317317 {
@@ -326,9 +326,9 @@ private async Task InsertJoinRecordsAsync(
326326 var pkProp = inverseFk . PrincipalKey . Properties [ i ] ;
327327
328328 var pkValue = GetPropertyValue ( record . RightEntity , pkProp . Name ) ;
329- if ( isDictionary )
329+ if ( dictEntry != null )
330330 {
331- ( ( IDictionary < string , object > ) joinEntry ) [ fkProp . Name ] = pkValue ! ;
331+ dictEntry [ fkProp . Name ] = pkValue ! ;
332332 }
333333 else
334334 {
You can’t perform that action at this time.
0 commit comments