@@ -98,9 +98,9 @@ public override async Task<object> ReplaceAsync(object original, object target,
98
98
{
99
99
return target ;
100
100
}
101
- if ( session . GetContextEntityIdentifier ( original ) == null && ( await ( ForeignKeys . IsTransientFastAsync ( associatedEntityName , original , session , cancellationToken ) ) . ConfigureAwait ( false ) ) . GetValueOrDefault ( ) )
101
+ if ( session . GetContextEntityIdentifier ( original ) == null && ( await ( ForeignKeys . IsTransientFastAsync ( _associatedEntityName , original , session , cancellationToken ) ) . ConfigureAwait ( false ) ) . GetValueOrDefault ( ) )
102
102
{
103
- object copy = session . Factory . GetEntityPersister ( associatedEntityName ) . Instantiate ( null ) ;
103
+ object copy = session . Factory . GetEntityPersister ( _associatedEntityName ) . Instantiate ( null ) ;
104
104
//TODO: should this be Session.instantiate(Persister, ...)?
105
105
copyCache . Add ( original , copy ) ;
106
106
return copy ;
@@ -129,7 +129,7 @@ public override async Task<object> ReplaceAsync(object original, object target,
129
129
/// <returns>
130
130
/// An instance of the object or <see langword="null" /> if the identifer was null.
131
131
/// </returns>
132
- public override sealed async Task < object > NullSafeGetAsync ( DbDataReader rs , string [ ] names , ISessionImplementor session , object owner , CancellationToken cancellationToken )
132
+ public sealed override async Task < object > NullSafeGetAsync ( DbDataReader rs , string [ ] names , ISessionImplementor session , object owner , CancellationToken cancellationToken )
133
133
{
134
134
cancellationToken . ThrowIfCancellationRequested ( ) ;
135
135
return await ( ResolveIdentifierAsync ( await ( HydrateAsync ( rs , names , session , owner , cancellationToken ) ) . ConfigureAwait ( false ) , session , owner , cancellationToken ) ) . ConfigureAwait ( false ) ;
@@ -144,10 +144,10 @@ protected async Task<object> ResolveIdentifierAsync(object id, ISessionImplement
144
144
{
145
145
cancellationToken . ThrowIfCancellationRequested ( ) ;
146
146
string entityName = GetAssociatedEntityName ( ) ;
147
- bool isProxyUnwrapEnabled = unwrapProxy && session . Factory
147
+ bool isProxyUnwrapEnabled = _unwrapProxy && session . Factory
148
148
. GetEntityPersister ( entityName ) . IsInstrumented ;
149
149
150
- object proxyOrEntity = await ( session . InternalLoadAsync ( entityName , id , eager , IsNullable && ! isProxyUnwrapEnabled , cancellationToken ) ) . ConfigureAwait ( false ) ;
150
+ object proxyOrEntity = await ( session . InternalLoadAsync ( entityName , id , _eager , IsNullable && ! isProxyUnwrapEnabled , cancellationToken ) ) . ConfigureAwait ( false ) ;
151
151
152
152
if ( proxyOrEntity . IsProxy ( ) )
153
153
{
@@ -178,21 +178,19 @@ public override Task<object> ResolveIdentifierAsync(object value, ISessionImplem
178
178
{
179
179
return Task . FromResult < object > ( null ) ;
180
180
}
181
- else
181
+
182
+ if ( IsNull ( owner , session ) )
182
183
{
183
- if ( IsNull ( owner , session ) )
184
- {
185
- return Task . FromResult < object > ( null ) ; //EARLY EXIT!
186
- }
184
+ return Task . FromResult < object > ( null ) ; //EARLY EXIT!
185
+ }
187
186
188
- if ( IsReferenceToPrimaryKey )
189
- {
190
- return ResolveIdentifierAsync ( value , session , cancellationToken ) ;
191
- }
192
- else
193
- {
194
- return LoadByUniqueKeyAsync ( GetAssociatedEntityName ( ) , uniqueKeyPropertyName , value , session , cancellationToken ) ;
195
- }
187
+ if ( IsReferenceToPrimaryKey )
188
+ {
189
+ return ResolveIdentifierAsync ( value , session , cancellationToken ) ;
190
+ }
191
+ else
192
+ {
193
+ return LoadByUniqueKeyAsync ( GetAssociatedEntityName ( ) , uniqueKeyPropertyName , value , session , cancellationToken ) ;
196
194
}
197
195
}
198
196
catch ( Exception ex )
0 commit comments