From c4e11d29f434a494c9bf9bfbf4c6762097942733 Mon Sep 17 00:00:00 2001 From: Anthony Sneed Date: Tue, 24 Nov 2020 15:17:41 -0600 Subject: [PATCH] Fix TraverseGraph HashSet --- TrackableEntities.EF.Core/DbContextExtensionsInternal.cs | 8 ++++---- .../TrackableEntities.EF.Core.csproj | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TrackableEntities.EF.Core/DbContextExtensionsInternal.cs b/TrackableEntities.EF.Core/DbContextExtensionsInternal.cs index 9ddd790..4814684 100644 --- a/TrackableEntities.EF.Core/DbContextExtensionsInternal.cs +++ b/TrackableEntities.EF.Core/DbContextExtensionsInternal.cs @@ -28,19 +28,19 @@ public static void TraverseGraph(this DbContext context, object item, var node = new EntityEntryGraphNode(stateManager.GetOrCreateEntry(item), null, null, null); IEntityEntryGraphIterator graphIterator = new EntityEntryGraphIterator(); #pragma warning restore EF1001 // Internal EF Core API usage. - var visited = new HashSet(); + var visited = new HashSet(); - graphIterator.TraverseGraph(node, n => + graphIterator.TraverseGraph(node, n => { // Check visited - if (visited.Contains(n.Entry.Entity.GetHashCode())) + if (visited.Contains(n.Entry.Entity)) return false; // Execute callback callback(n); // Add visited - visited.Add(n.Entry.Entity.GetHashCode()); + visited.Add(n.Entry.Entity); // Continue traversal return true; diff --git a/TrackableEntities.EF.Core/TrackableEntities.EF.Core.csproj b/TrackableEntities.EF.Core/TrackableEntities.EF.Core.csproj index 60220e5..fe47fea 100644 --- a/TrackableEntities.EF.Core/TrackableEntities.EF.Core.csproj +++ b/TrackableEntities.EF.Core/TrackableEntities.EF.Core.csproj @@ -3,7 +3,7 @@ netstandard2.1 true - 5.0.0 + 5.0.1 Tony Sneed Tony Sneed Trackable Entities for EF Core @@ -12,7 +12,7 @@ https://github.com/TrackableEntities/TrackableEntities.Core icon.png change-tracking entity-framework-core n-tier - See: https://github.com/TrackableEntities/TrackableEntities.Core/releases/tag/v5.0.0 + See: https://github.com/TrackableEntities/TrackableEntities.Core/releases/tag/v5.0.1 true