@@ -91,23 +91,23 @@ private void Do(Action<ChangeTracker> action)
9191
9292 public override void TrackGraph ( object rootEntity , Action < EntityEntryGraphNode > callback )
9393 {
94- if ( _dbContext is ICurrentDbContextDiscover )
94+ if ( _dbContext is IShardingDbContext shardingDbContext )
9595 {
96- Do ( c => c . TrackGraph ( rootEntity , callback ) ) ;
97- return ;
96+ var genericDbContext = shardingDbContext . CreateGenericDbContext ( rootEntity ) ;
97+ genericDbContext . ChangeTracker . TrackGraph ( rootEntity , callback ) ;
98+ // Do(c => c.TrackGraph(rootEntity,callback));
9899 }
99- base . TrackGraph ( rootEntity , callback ) ;
100100 }
101101
102102#if ! EFCORE2
103103 public override void TrackGraph < TState > ( object rootEntity , TState state , Func < EntityEntryGraphNode < TState > , bool > callback ) where TState : default
104104 {
105- if ( _dbContext is ICurrentDbContextDiscover )
105+ if ( _dbContext is IShardingDbContext shardingDbContext )
106106 {
107- Do ( c => c . TrackGraph ( rootEntity , state , callback ) ) ;
108- return ;
107+ var genericDbContext = shardingDbContext . CreateGenericDbContext ( rootEntity ) ;
108+ genericDbContext . ChangeTracker . TrackGraph ( rootEntity , state , callback ) ;
109+ // Do(c => c.TrackGraph(rootEntity,callback));
109110 }
110- base . TrackGraph ( rootEntity , state , callback ) ;
111111 }
112112
113113 public override void CascadeChanges ( )
@@ -136,12 +136,12 @@ public override void Clear()
136136#if EFCORE2
137137 public override void TrackGraph < TState > ( object rootEntity , TState state , Func < EntityEntryGraphNode , TState , bool > callback )
138138 {
139- if ( _dbContext is ICurrentDbContextDiscover )
139+ if ( _dbContext is IShardingDbContext shardingDbContext )
140140 {
141- Do ( c => c . TrackGraph ( rootEntity , state , callback ) ) ;
142- return ;
141+ var genericDbContext = shardingDbContext . CreateGenericDbContext ( rootEntity ) ;
142+ genericDbContext . ChangeTracker . TrackGraph ( rootEntity , state , callback ) ;
143+ // Do(c => c.TrackGraph(rootEntity,callback));
143144 }
144- base . TrackGraph ( rootEntity , state , callback ) ;
145145 }
146146#endif
147147 }
0 commit comments