Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros committed Nov 14, 2024
1 parent f24ad80 commit d2b899d
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/YesSql.Core/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,12 @@ public void DetachAll(string collection)

var state = GetState(collection);

foreach (var item in state.IdentityMap.GetAll())
{
state.Saved.Remove(item);
state.Updated.Remove(item);
state.Tracked.Remove(item);
state.Deleted.Remove(item);
}

state.IdentityMap.Clear();
state._concurrent?.Clear();
state._saved?.Clear();
state._updated?.Clear();
state._tracked?.Clear();
state._deleted?.Clear();
state._identityMap?.Clear();
}

public async Task ResetAsync()
Expand Down Expand Up @@ -988,7 +985,6 @@ private async Task ReleaseTransactionAsync()
{
foreach (var state in _collectionStates.Values)
{
// IdentityMap is cleared in ReleaseSession()
state._concurrent?.Clear();
state._saved?.Clear();
state._updated?.Clear();
Expand Down

0 comments on commit d2b899d

Please sign in to comment.