Skip to content

Commit

Permalink
Fix GetReferencingForeignKeys for derived types
Browse files Browse the repository at this point in the history
Use ReferenceEqualityComparer in StateManager

Fixes #6055
  • Loading branch information
AndriySvyryd committed Jul 21, 2016
1 parent 11c0d37 commit 7b65547
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class StateManager : IStateManager

private readonly LazyRef<IDictionary<object, IList<Tuple<INavigation, InternalEntityEntry>>>> _referencedUntrackedEntities
= new LazyRef<IDictionary<object, IList<Tuple<INavigation, InternalEntityEntry>>>>(
() => new Dictionary<object, IList<Tuple<INavigation, InternalEntityEntry>>>());
() => new Dictionary<object, IList<Tuple<INavigation, InternalEntityEntry>>>(ReferenceEqualityComparer.Instance));

private IIdentityMap _identityMap0;
private IIdentityMap _identityMap1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ private ForeignKey RemoveForeignKey([NotNull] ForeignKey foreignKey, bool runCon
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public virtual IEnumerable<ForeignKey> GetReferencingForeignKeys()
=> _baseType?.GetDeclaredReferencingForeignKeys().Concat(GetDeclaredReferencingForeignKeys())
=> _baseType?.GetReferencingForeignKeys().Concat(GetDeclaredReferencingForeignKeys())
?? GetDeclaredReferencingForeignKeys();

/// <summary>
Expand Down

0 comments on commit 7b65547

Please sign in to comment.