@@ -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 ) ;
@@ -513,9 +513,10 @@ public CollectionEntry GetCollectionEntry(IPersistentCollection coll)
513
513
}
514
514
515
515
/// <summary> Adds an entity to the internal caches.</summary>
516
- public EntityEntry AddEntity ( object entity , Status status , object [ ] loadedState , EntityKey entityKey , object version ,
517
- LockMode lockMode , bool existsInDatabase , IEntityPersister persister ,
518
- bool disableVersionIncrement , bool lazyPropertiesAreUnfetched )
516
+ public EntityEntry AddEntity (
517
+ object entity , Status status , object [ ] loadedState , in EntityKey entityKey , object version ,
518
+ LockMode lockMode , bool existsInDatabase , IEntityPersister persister ,
519
+ bool disableVersionIncrement , bool lazyPropertiesAreUnfetched )
519
520
{
520
521
AddEntity ( entityKey , entity ) ;
521
522
@@ -681,9 +682,9 @@ public object UnproxyAndReassociate(object maybeProxy)
681
682
/// Attempts to check whether the given key represents an entity already loaded within the
682
683
/// current session.
683
684
/// </summary>
684
- /// <param name="obj">The entity reference against which to perform the uniqueness check.</param>
685
685
/// <param name="key">The entity key.</param>
686
- public void CheckUniqueness ( EntityKey key , object obj )
686
+ /// <param name="obj">The entity reference against which to perform the uniqueness check.</param>
687
+ public void CheckUniqueness ( in EntityKey key , object obj )
687
688
{
688
689
object entity = GetEntity ( key ) ;
689
690
if ( entity == obj )
@@ -707,7 +708,7 @@ public void CheckUniqueness(EntityKey key, object obj)
707
708
/// <param name="key">The internal cache key for the proxied entity. </param>
708
709
/// <param name="obj">(optional) the actual proxied entity instance. </param>
709
710
/// <returns> An appropriately narrowed instance. </returns>
710
- public object NarrowProxy ( INHibernateProxy proxy , IEntityPersister persister , EntityKey key , object obj )
711
+ public object NarrowProxy ( INHibernateProxy proxy , IEntityPersister persister , in EntityKey key , object obj )
711
712
{
712
713
bool alreadyNarrow = persister . ConcreteProxyClass . IsInstanceOfType ( proxy ) ;
713
714
@@ -751,7 +752,7 @@ public object NarrowProxy(INHibernateProxy proxy, IEntityPersister persister, En
751
752
/// third argument (the entity associated with the key) if no proxy exists. Init
752
753
/// the proxy to the target implementation, if necessary.
753
754
/// </summary>
754
- public object ProxyFor ( IEntityPersister persister , EntityKey key , object impl )
755
+ public object ProxyFor ( IEntityPersister persister , in EntityKey key , object impl )
755
756
{
756
757
if ( ! persister . HasProxy || key . IsNull )
757
758
return impl ;
@@ -1045,7 +1046,7 @@ public CollectionEntry GetCollectionEntryOrNull(object collection)
1045
1046
}
1046
1047
1047
1048
/// <summary> Get an existing proxy by key</summary>
1048
- public object GetProxy ( EntityKey key )
1049
+ public object GetProxy ( in EntityKey key )
1049
1050
{
1050
1051
INHibernateProxy result ;
1051
1052
if ( proxiesByKey . TryGetValue ( key , out result ) )
@@ -1055,13 +1056,13 @@ public object GetProxy(EntityKey key)
1055
1056
}
1056
1057
1057
1058
/// <summary> Add a proxy to the session cache</summary>
1058
- public void AddProxy ( EntityKey key , INHibernateProxy proxy )
1059
+ public void AddProxy ( in EntityKey key , INHibernateProxy proxy )
1059
1060
{
1060
1061
proxiesByKey [ key ] = proxy ;
1061
1062
}
1062
1063
1063
1064
/// <summary> Remove a proxy from the session cache</summary>
1064
- public object RemoveProxy ( EntityKey key )
1065
+ public object RemoveProxy ( in EntityKey key )
1065
1066
{
1066
1067
if ( batchFetchQueue != null )
1067
1068
{
@@ -1264,13 +1265,13 @@ private object GetIndexInParent(string property, object childEntity, IEntityPers
1264
1265
/// <summary>
1265
1266
/// Record the fact that the association belonging to the keyed entity is null.
1266
1267
/// </summary>
1267
- public void AddNullProperty ( EntityKey ownerKey , string propertyName )
1268
+ public void AddNullProperty ( in EntityKey ownerKey , string propertyName )
1268
1269
{
1269
1270
nullAssociations . Add ( new AssociationKey ( ownerKey , propertyName ) ) ;
1270
1271
}
1271
1272
1272
1273
/// <summary> Is the association property belonging to the keyed entity null?</summary>
1273
- public bool IsPropertyNull ( EntityKey ownerKey , string propertyName )
1274
+ public bool IsPropertyNull ( in EntityKey ownerKey , string propertyName )
1274
1275
{
1275
1276
return nullAssociations . Contains ( new AssociationKey ( ownerKey , propertyName ) ) ;
1276
1277
}
@@ -1351,7 +1352,7 @@ public bool IsReadOnly(object entityOrProxy)
1351
1352
return isReadOnly ;
1352
1353
}
1353
1354
1354
- public void ReplaceDelayedEntityIdentityInsertKeys ( EntityKey oldKey , object generatedId )
1355
+ public void ReplaceDelayedEntityIdentityInsertKeys ( in EntityKey oldKey , object generatedId )
1355
1356
{
1356
1357
object tempObject = entitiesByKey [ oldKey ] ;
1357
1358
entitiesByKey . Remove ( oldKey ) ;
0 commit comments