We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f1c811 commit a73a2e3Copy full SHA for a73a2e3
src/JsonApiDotNetCore/Repositories/DbContextExtensions.cs
@@ -1,5 +1,4 @@
1
using System;
2
-using System.Collections.Generic;
3
using System.Linq;
4
using JetBrains.Annotations;
5
using JsonApiDotNetCore.Resources;
@@ -58,12 +57,7 @@ public static void ResetChangeTracker(this DbContext dbContext)
58
57
{
59
ArgumentGuard.NotNull(dbContext, nameof(dbContext));
60
61
- List<EntityEntry> entriesWithChanges = dbContext.ChangeTracker.Entries().ToList();
62
-
63
- foreach (EntityEntry entry in entriesWithChanges)
64
- {
65
- entry.State = EntityState.Detached;
66
- }
+ dbContext.ChangeTracker.Clear();
67
}
68
69
0 commit comments