/// <summary> /// Get the current state of the entity as known to the underlying /// database, or null if there is no corresponding row /// </summary> public object[] GetDatabaseSnapshot(object id, IEntityPersister persister) { EntityKey key = new EntityKey(id, persister, session.EntityMode); object cached; if (entitySnapshotsByKey.TryGetValue(key, out cached)) { return cached == NoRow ? null : (object[])cached; } else { object[] snapshot = persister.GetDatabaseSnapshot(id, session); entitySnapshotsByKey[key] = snapshot ?? NoRow; return snapshot; } }