-
Notifications
You must be signed in to change notification settings - Fork 933
Why use "RootEntityName" compare, not use "EntityName" in NHibernate/Engine /EntityKey.Equals0 #3478
-
NHibernate.Engine.EntityKey.cs
public bool Equals(EntityKey other) { if (other == null) { return false; } return other.RootEntityName.Equals(RootEntityName) && _persister.IdentifierType.IsEqual(other.Identifier, Identifier, _persister.Factory); }
Beta Was this translation helpful? Give feedback.
All reactions
Because that is the right thing to do.
nhibernate-core/src/NHibernate/Persister/Entity/IEntityPersister.cs
Lines 36 to 40 in 07c367f
Why should we use the EntityName
? In case we have a key from a proxy of a base class, we would no more be able to infer that the key points the same entity than a key of the entity loaded from its concrete type.
Replies: 1 comment
-
Because that is the right thing to do.
nhibernate-core/src/NHibernate/Persister/Entity/IEntityPersister.cs
Lines 36 to 40 in 07c367f
Why should we use the EntityName
? In case we have a key from a proxy of a base class, we would no more be able to infer that the key points the same entity than a key of the entity loaded from its concrete type.
Beta Was this translation helpful? Give feedback.