@@ -588,7 +588,6 @@ private async Task<object[]> GetRowAsync(DbDataReader rs, ILoadable[] persisters
588588 {
589589 cancellationToken . ThrowIfCancellationRequested ( ) ;
590590 int cols = persisters . Length ;
591- IEntityAliases [ ] descriptors = EntityAliases ;
592591
593592 if ( Log . IsDebugEnabled ( ) )
594593 {
@@ -635,7 +634,7 @@ private async Task<object[]> GetRowAsync(DbDataReader rs, ILoadable[] persisters
635634 else
636635 {
637636 obj =
638- await ( InstanceNotYetLoadedAsync ( rs , i , persister , key , lockModes [ i ] , descriptors [ i ] . RowIdAlias , optionalObjectKey ,
637+ await ( InstanceNotYetLoadedAsync ( rs , i , persister , key , lockModes [ i ] , optionalObjectKey ,
639638 optionalObject , hydratedObjects , session , cancellationToken ) ) . ConfigureAwait ( false ) ;
640639 }
641640 // #1226: Even if it is already loaded, if it can be loaded from an association with a property ref, make
@@ -683,7 +682,7 @@ private async Task InstanceAlreadyLoadedAsync(DbDataReader rs, int i, IEntityPer
683682 /// The entity instance is not in the session cache
684683 /// </summary>
685684 private async Task < object > InstanceNotYetLoadedAsync ( DbDataReader dr , int i , ILoadable persister , EntityKey key , LockMode lockMode ,
686- string rowIdAlias , EntityKey optionalObjectKey , object optionalObject ,
685+ EntityKey optionalObjectKey , object optionalObject ,
687686 IList hydratedObjects , ISessionImplementor session , CancellationToken cancellationToken )
688687 {
689688 cancellationToken . ThrowIfCancellationRequested ( ) ;
@@ -707,7 +706,7 @@ private async Task<object> InstanceNotYetLoadedAsync(DbDataReader dr, int i, ILo
707706 // (but don't yet initialize the object itself)
708707 // note that we acquired LockMode.READ even if it was not requested
709708 LockMode acquiredLockMode = lockMode == LockMode . None ? LockMode . Read : lockMode ;
710- await ( LoadFromResultSetAsync ( dr , i , obj , instanceClass , key , rowIdAlias , acquiredLockMode , persister , session , cancellationToken ) ) . ConfigureAwait ( false ) ;
709+ await ( LoadFromResultSetAsync ( dr , i , obj , instanceClass , key , acquiredLockMode , persister , session , cancellationToken ) ) . ConfigureAwait ( false ) ;
711710
712711 // materialize associations (and initialize the object) later
713712 hydratedObjects . Add ( obj ) ;
@@ -721,7 +720,7 @@ private async Task<object> InstanceNotYetLoadedAsync(DbDataReader dr, int i, ILo
721720 /// and pass the hydrated state to the session.
722721 /// </summary>
723722 private async Task LoadFromResultSetAsync ( DbDataReader rs , int i , object obj , string instanceClass , EntityKey key ,
724- string rowIdAlias , LockMode lockMode , ILoadable rootPersister ,
723+ LockMode lockMode , ILoadable rootPersister ,
725724 ISessionImplementor session , CancellationToken cancellationToken )
726725 {
727726 cancellationToken . ThrowIfCancellationRequested ( ) ;
@@ -750,7 +749,7 @@ private async Task LoadFromResultSetAsync(DbDataReader rs, int i, object obj, st
750749
751750 object [ ] values = await ( persister . HydrateAsync ( rs , id , obj , rootPersister , cols , eagerPropertyFetch , session , cancellationToken ) ) . ConfigureAwait ( false ) ;
752751
753- object rowId = persister . HasRowId ? rs [ rowIdAlias ] : null ;
752+ object rowId = persister . HasRowId ? rs [ EntityAliases [ i ] . RowIdAlias ] : null ;
754753
755754 TwoPhaseLoad . PostHydrate ( persister , id , values , rowId , obj , lockMode , ! eagerPropertyFetch , session ) ;
756755 }
0 commit comments