@@ -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 ) ;
@@ -525,7 +525,7 @@ public EntityEntry AddEntity(object entity, Status status, object[] loadedState,
525525 }
526526
527527 /// <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 ,
529529 LockMode lockMode , bool existsInDatabase , IEntityPersister persister ,
530530 bool disableVersionIncrement )
531531 {
@@ -712,9 +712,9 @@ public object UnproxyAndReassociate(object maybeProxy)
712712 /// Attempts to check whether the given key represents an entity already loaded within the
713713 /// current session.
714714 /// </summary>
715- /// <param name="obj">The entity reference against which to perform the uniqueness check.</param>
716715 /// <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 )
718718 {
719719 object entity = GetEntity ( key ) ;
720720 if ( entity == obj )
@@ -738,7 +738,7 @@ public void CheckUniqueness(EntityKey key, object obj)
738738 /// <param name="key">The internal cache key for the proxied entity. </param>
739739 /// <param name="obj">(optional) the actual proxied entity instance. </param>
740740 /// <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 )
742742 {
743743 bool alreadyNarrow = persister . ConcreteProxyClass . IsInstanceOfType ( proxy ) ;
744744
@@ -782,7 +782,7 @@ public object NarrowProxy(INHibernateProxy proxy, IEntityPersister persister, En
782782 /// third argument (the entity associated with the key) if no proxy exists. Init
783783 /// the proxy to the target implementation, if necessary.
784784 /// </summary>
785- public object ProxyFor ( IEntityPersister persister , EntityKey key , object impl )
785+ public object ProxyFor ( IEntityPersister persister , in EntityKey key , object impl )
786786 {
787787 if ( ! persister . HasProxy || key . IsNull )
788788 return impl ;
@@ -1076,7 +1076,7 @@ public CollectionEntry GetCollectionEntryOrNull(object collection)
10761076 }
10771077
10781078 /// <summary> Get an existing proxy by key</summary>
1079- public object GetProxy ( EntityKey key )
1079+ public object GetProxy ( in EntityKey key )
10801080 {
10811081 INHibernateProxy result ;
10821082 if ( proxiesByKey . TryGetValue ( key , out result ) )
@@ -1086,13 +1086,13 @@ public object GetProxy(EntityKey key)
10861086 }
10871087
10881088 /// <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 )
10901090 {
10911091 proxiesByKey [ key ] = proxy ;
10921092 }
10931093
10941094 /// <summary> Remove a proxy from the session cache</summary>
1095- public object RemoveProxy ( EntityKey key )
1095+ public object RemoveProxy ( in EntityKey key )
10961096 {
10971097 if ( batchFetchQueue != null )
10981098 {
@@ -1295,13 +1295,13 @@ private object GetIndexInParent(string property, object childEntity, IEntityPers
12951295 /// <summary>
12961296 /// Record the fact that the association belonging to the keyed entity is null.
12971297 /// </summary>
1298- public void AddNullProperty ( EntityKey ownerKey , string propertyName )
1298+ public void AddNullProperty ( in EntityKey ownerKey , string propertyName )
12991299 {
13001300 nullAssociations . Add ( new AssociationKey ( ownerKey , propertyName ) ) ;
13011301 }
13021302
13031303 /// <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 )
13051305 {
13061306 return nullAssociations . Contains ( new AssociationKey ( ownerKey , propertyName ) ) ;
13071307 }
@@ -1382,7 +1382,7 @@ public bool IsReadOnly(object entityOrProxy)
13821382 return isReadOnly ;
13831383 }
13841384
1385- public void ReplaceDelayedEntityIdentityInsertKeys ( EntityKey oldKey , object generatedId )
1385+ public void ReplaceDelayedEntityIdentityInsertKeys ( in EntityKey oldKey , object generatedId )
13861386 {
13871387 object tempObject = entitiesByKey [ oldKey ] ;
13881388 entitiesByKey . Remove ( oldKey ) ;
0 commit comments