本文整理匯總了C#中NHibernate.Engine.EntityKey.Equals方法的典型用法代碼示例。如果您正苦於以下問題:C# EntityKey.Equals方法的具體用法?C# EntityKey.Equals怎麽用?C# EntityKey.Equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NHibernate.Engine.EntityKey
的用法示例。
在下文中一共展示了EntityKey.Equals方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: InstanceNotYetLoaded
/// <summary>
/// The entity instance is not in the session cache
/// </summary>
private object InstanceNotYetLoaded(IDataReader dr, int i, ILoadable persister, EntityKey key, LockMode lockMode,
string rowIdAlias, EntityKey optionalObjectKey, object optionalObject,
IList hydratedObjects, ISessionImplementor session)
{
object obj;
string instanceClass = GetInstanceClass(dr, i, persister, key.Identifier, session);
if (optionalObjectKey != null && key.Equals(optionalObjectKey))
{
// its the given optional object
obj = optionalObject;
}
else
{
obj = session.Instantiate(instanceClass, key.Identifier);
}
// need to hydrate it
// grab its state from the DataReader and keep it in the Session
// (but don't yet initialize the object itself)
// note that we acquired LockMode.READ even if it was not requested
LockMode acquiredLockMode = lockMode == LockMode.None ? LockMode.Read : lockMode;
LoadFromResultSet(dr, i, obj, instanceClass, key, rowIdAlias, acquiredLockMode, persister, session);
// materialize associations (and initialize the object) later
hydratedObjects.Add(obj);
return obj;
}