@@ -355,7 +355,7 @@ public object[] GetDatabaseSnapshot(object id, IEntityPersister persister)
355
355
/// <item><description>an entry of NO_ROW here is interpreted as an exception</description></item>
356
356
/// </list>
357
357
/// </remarks>
358
- public object [ ] GetCachedDatabaseSnapshot ( EntityKey key )
358
+ public object [ ] GetCachedDatabaseSnapshot ( in EntityKey key )
359
359
{
360
360
object snapshot ;
361
361
if ( ! entitySnapshotsByKey . TryGetValue ( key , out snapshot ) )
@@ -418,7 +418,7 @@ public object[] GetNaturalIdSnapshot(object id, IEntityPersister persister)
418
418
}
419
419
420
420
/// <summary> Add a canonical mapping from entity key to entity instance</summary>
421
- public void AddEntity ( EntityKey key , object entity )
421
+ public void AddEntity ( in EntityKey key , object entity )
422
422
{
423
423
entitiesByKey [ key ] = entity ;
424
424
BatchFetchQueue . RemoveBatchLoadableEntityKey ( key ) ;
@@ -427,15 +427,15 @@ public void AddEntity(EntityKey key, object entity)
427
427
/// <summary>
428
428
/// Get the entity instance associated with the given <tt>EntityKey</tt>
429
429
/// </summary>
430
- public object GetEntity ( EntityKey key )
430
+ public object GetEntity ( in EntityKey key )
431
431
{
432
432
object result ;
433
433
entitiesByKey . TryGetValue ( key , out result ) ;
434
434
return result ;
435
435
}
436
436
437
437
/// <summary> Is there an entity with the given key in the persistence context</summary>
438
- public bool ContainsEntity ( EntityKey key )
438
+ public bool ContainsEntity ( in EntityKey key )
439
439
{
440
440
return entitiesByKey . ContainsKey ( key ) ;
441
441
}
@@ -445,7 +445,7 @@ public bool ContainsEntity(EntityKey key)
445
445
/// up other state associated with the entity, all except
446
446
/// for the <tt>EntityEntry</tt>
447
447
/// </summary>
448
- public object RemoveEntity ( EntityKey key )
448
+ public object RemoveEntity ( in EntityKey key )
449
449
{
450
450
object tempObject = entitiesByKey [ key ] ;
451
451
entitiesByKey . Remove ( key ) ;
@@ -525,7 +525,7 @@ public EntityEntry AddEntity(object entity, Status status, object[] loadedState,
525
525
}
526
526
527
527
/// <summary> Adds an entity to the internal caches.</summary>
528
- public EntityEntry AddEntity ( object entity , Status status , object [ ] loadedState , EntityKey entityKey , object version ,
528
+ public EntityEntry AddEntity ( object entity , Status status , object [ ] loadedState , in EntityKey entityKey , object version ,
529
529
LockMode lockMode , bool existsInDatabase , IEntityPersister persister ,
530
530
bool disableVersionIncrement )
531
531
{
@@ -712,9 +712,9 @@ public object UnproxyAndReassociate(object maybeProxy)
712
712
/// Attempts to check whether the given key represents an entity already loaded within the
713
713
/// current session.
714
714
/// </summary>
715
- /// <param name="obj">The entity reference against which to perform the uniqueness check.</param>
716
715
/// <param name="key">The entity key.</param>
717
- public void CheckUniqueness ( EntityKey key , object obj )
716
+ /// <param name="obj">The entity reference against which to perform the uniqueness check.</param>
717
+ public void CheckUniqueness ( in EntityKey key , object obj )
718
718
{
719
719
object entity = GetEntity ( key ) ;
720
720
if ( entity == obj )
@@ -738,7 +738,7 @@ public void CheckUniqueness(EntityKey key, object obj)
738
738
/// <param name="key">The internal cache key for the proxied entity. </param>
739
739
/// <param name="obj">(optional) the actual proxied entity instance. </param>
740
740
/// <returns> An appropriately narrowed instance. </returns>
741
- public object NarrowProxy ( INHibernateProxy proxy , IEntityPersister persister , EntityKey key , object obj )
741
+ public object NarrowProxy ( INHibernateProxy proxy , IEntityPersister persister , in EntityKey key , object obj )
742
742
{
743
743
bool alreadyNarrow = persister . ConcreteProxyClass . IsInstanceOfType ( proxy ) ;
744
744
@@ -782,7 +782,7 @@ public object NarrowProxy(INHibernateProxy proxy, IEntityPersister persister, En
782
782
/// third argument (the entity associated with the key) if no proxy exists. Init
783
783
/// the proxy to the target implementation, if necessary.
784
784
/// </summary>
785
- public object ProxyFor ( IEntityPersister persister , EntityKey key , object impl )
785
+ public object ProxyFor ( IEntityPersister persister , in EntityKey key , object impl )
786
786
{
787
787
if ( ! persister . HasProxy || key . IsNull )
788
788
return impl ;
@@ -1076,7 +1076,7 @@ public CollectionEntry GetCollectionEntryOrNull(object collection)
1076
1076
}
1077
1077
1078
1078
/// <summary> Get an existing proxy by key</summary>
1079
- public object GetProxy ( EntityKey key )
1079
+ public object GetProxy ( in EntityKey key )
1080
1080
{
1081
1081
INHibernateProxy result ;
1082
1082
if ( proxiesByKey . TryGetValue ( key , out result ) )
@@ -1086,13 +1086,13 @@ public object GetProxy(EntityKey key)
1086
1086
}
1087
1087
1088
1088
/// <summary> Add a proxy to the session cache</summary>
1089
- public void AddProxy ( EntityKey key , INHibernateProxy proxy )
1089
+ public void AddProxy ( in EntityKey key , INHibernateProxy proxy )
1090
1090
{
1091
1091
proxiesByKey [ key ] = proxy ;
1092
1092
}
1093
1093
1094
1094
/// <summary> Remove a proxy from the session cache</summary>
1095
- public object RemoveProxy ( EntityKey key )
1095
+ public object RemoveProxy ( in EntityKey key )
1096
1096
{
1097
1097
if ( batchFetchQueue != null )
1098
1098
{
@@ -1295,13 +1295,13 @@ private object GetIndexInParent(string property, object childEntity, IEntityPers
1295
1295
/// <summary>
1296
1296
/// Record the fact that the association belonging to the keyed entity is null.
1297
1297
/// </summary>
1298
- public void AddNullProperty ( EntityKey ownerKey , string propertyName )
1298
+ public void AddNullProperty ( in EntityKey ownerKey , string propertyName )
1299
1299
{
1300
1300
nullAssociations . Add ( new AssociationKey ( ownerKey , propertyName ) ) ;
1301
1301
}
1302
1302
1303
1303
/// <summary> Is the association property belonging to the keyed entity null?</summary>
1304
- public bool IsPropertyNull ( EntityKey ownerKey , string propertyName )
1304
+ public bool IsPropertyNull ( in EntityKey ownerKey , string propertyName )
1305
1305
{
1306
1306
return nullAssociations . Contains ( new AssociationKey ( ownerKey , propertyName ) ) ;
1307
1307
}
@@ -1382,7 +1382,7 @@ public bool IsReadOnly(object entityOrProxy)
1382
1382
return isReadOnly ;
1383
1383
}
1384
1384
1385
- public void ReplaceDelayedEntityIdentityInsertKeys ( EntityKey oldKey , object generatedId )
1385
+ public void ReplaceDelayedEntityIdentityInsertKeys ( in EntityKey oldKey , object generatedId )
1386
1386
{
1387
1387
object tempObject = entitiesByKey [ oldKey ] ;
1388
1388
entitiesByKey . Remove ( oldKey ) ;
0 commit comments