@@ -355,7 +355,7 @@ public object[] GetDatabaseSnapshot(object id, IEntityPersister persister)
355355 /// <item><description>an entry of NO_ROW here is interpreted as an exception</description></item>
356356 /// </list>
357357 /// </remarks>
358- public object [ ] GetCachedDatabaseSnapshot ( EntityKey key )
358+ public object [ ] GetCachedDatabaseSnapshot ( in EntityKey key )
359359 {
360360 object snapshot ;
361361 if ( ! entitySnapshotsByKey . TryGetValue ( key , out snapshot ) )
@@ -418,7 +418,7 @@ public object[] GetNaturalIdSnapshot(object id, IEntityPersister persister)
418418 }
419419
420420 /// <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 )
422422 {
423423 entitiesByKey [ key ] = entity ;
424424 BatchFetchQueue . RemoveBatchLoadableEntityKey ( key ) ;
@@ -427,15 +427,15 @@ public void AddEntity(EntityKey key, object entity)
427427 /// <summary>
428428 /// Get the entity instance associated with the given <tt>EntityKey</tt>
429429 /// </summary>
430- public object GetEntity ( EntityKey key )
430+ public object GetEntity ( in EntityKey key )
431431 {
432432 object result ;
433433 entitiesByKey . TryGetValue ( key , out result ) ;
434434 return result ;
435435 }
436436
437437 /// <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 )
439439 {
440440 return entitiesByKey . ContainsKey ( key ) ;
441441 }
@@ -445,7 +445,7 @@ public bool ContainsEntity(EntityKey key)
445445 /// up other state associated with the entity, all except
446446 /// for the <tt>EntityEntry</tt>
447447 /// </summary>
448- public object RemoveEntity ( EntityKey key )
448+ public object RemoveEntity ( in EntityKey key )
449449 {
450450 object tempObject = entitiesByKey [ key ] ;
451451 entitiesByKey . Remove ( key ) ;
@@ -513,9 +513,10 @@ public CollectionEntry GetCollectionEntry(IPersistentCollection coll)
513513 }
514514
515515 /// <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 )
519520 {
520521 AddEntity ( entityKey , entity ) ;
521522
@@ -681,9 +682,9 @@ public object UnproxyAndReassociate(object maybeProxy)
681682 /// Attempts to check whether the given key represents an entity already loaded within the
682683 /// current session.
683684 /// </summary>
684- /// <param name="obj">The entity reference against which to perform the uniqueness check.</param>
685685 /// <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 )
687688 {
688689 object entity = GetEntity ( key ) ;
689690 if ( entity == obj )
@@ -707,7 +708,7 @@ public void CheckUniqueness(EntityKey key, object obj)
707708 /// <param name="key">The internal cache key for the proxied entity. </param>
708709 /// <param name="obj">(optional) the actual proxied entity instance. </param>
709710 /// <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 )
711712 {
712713 bool alreadyNarrow = persister . ConcreteProxyClass . IsInstanceOfType ( proxy ) ;
713714
@@ -751,7 +752,7 @@ public object NarrowProxy(INHibernateProxy proxy, IEntityPersister persister, En
751752 /// third argument (the entity associated with the key) if no proxy exists. Init
752753 /// the proxy to the target implementation, if necessary.
753754 /// </summary>
754- public object ProxyFor ( IEntityPersister persister , EntityKey key , object impl )
755+ public object ProxyFor ( IEntityPersister persister , in EntityKey key , object impl )
755756 {
756757 if ( ! persister . HasProxy || key . IsNull )
757758 return impl ;
@@ -1045,7 +1046,7 @@ public CollectionEntry GetCollectionEntryOrNull(object collection)
10451046 }
10461047
10471048 /// <summary> Get an existing proxy by key</summary>
1048- public object GetProxy ( EntityKey key )
1049+ public object GetProxy ( in EntityKey key )
10491050 {
10501051 INHibernateProxy result ;
10511052 if ( proxiesByKey . TryGetValue ( key , out result ) )
@@ -1055,13 +1056,13 @@ public object GetProxy(EntityKey key)
10551056 }
10561057
10571058 /// <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 )
10591060 {
10601061 proxiesByKey [ key ] = proxy ;
10611062 }
10621063
10631064 /// <summary> Remove a proxy from the session cache</summary>
1064- public object RemoveProxy ( EntityKey key )
1065+ public object RemoveProxy ( in EntityKey key )
10651066 {
10661067 if ( batchFetchQueue != null )
10671068 {
@@ -1264,13 +1265,13 @@ private object GetIndexInParent(string property, object childEntity, IEntityPers
12641265 /// <summary>
12651266 /// Record the fact that the association belonging to the keyed entity is null.
12661267 /// </summary>
1267- public void AddNullProperty ( EntityKey ownerKey , string propertyName )
1268+ public void AddNullProperty ( in EntityKey ownerKey , string propertyName )
12681269 {
12691270 nullAssociations . Add ( new AssociationKey ( ownerKey , propertyName ) ) ;
12701271 }
12711272
12721273 /// <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 )
12741275 {
12751276 return nullAssociations . Contains ( new AssociationKey ( ownerKey , propertyName ) ) ;
12761277 }
@@ -1351,7 +1352,7 @@ public bool IsReadOnly(object entityOrProxy)
13511352 return isReadOnly ;
13521353 }
13531354
1354- public void ReplaceDelayedEntityIdentityInsertKeys ( EntityKey oldKey , object generatedId )
1355+ public void ReplaceDelayedEntityIdentityInsertKeys ( in EntityKey oldKey , object generatedId )
13551356 {
13561357 object tempObject = entitiesByKey [ oldKey ] ;
13571358 entitiesByKey . Remove ( oldKey ) ;
0 commit comments