During merge, replace the existing (target) value in the entity we are merging to with a new (original) value from the detached entity we are merging. For immutable objects, or null values, it is safe to simply return the first parameter. For mutable objects, it is safe to return a copy of the first parameter. For objects with component values, it might make sense to recursively replace component values.

Namespace: NHibernate.Type
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
Object Replace(
	Object original,
	Object target,
	ISessionImplementor session,
	Object owner,
	IDictionary copyCache,
	ForeignKeyDirection foreignKeyDirection
)
Visual Basic
Function Replace ( _
	original As Object, _
	target As Object, _
	session As ISessionImplementor, _
	owner As Object, _
	copyCache As IDictionary, _
	foreignKeyDirection As ForeignKeyDirection _
) As Object
Visual C++
Object^ Replace(
	Object^ original, 
	Object^ target, 
	ISessionImplementor^ session, 
	Object^ owner, 
	IDictionary^ copyCache, 
	ForeignKeyDirection^ foreignKeyDirection
)

Parameters

original
Type: System..::..Object
the value from the detached entity being merged
target
Type: System..::..Object
the value in the managed entity
session
Type: NHibernate.Engine..::..ISessionImplementor

[Missing <param name="session"/> documentation for "M:NHibernate.Type.IType.Replace(System.Object,System.Object,NHibernate.Engine.ISessionImplementor,System.Object,System.Collections.IDictionary,NHibernate.Type.ForeignKeyDirection)"]

owner
Type: System..::..Object

[Missing <param name="owner"/> documentation for "M:NHibernate.Type.IType.Replace(System.Object,System.Object,NHibernate.Engine.ISessionImplementor,System.Object,System.Collections.IDictionary,NHibernate.Type.ForeignKeyDirection)"]

copyCache
Type: System.Collections..::..IDictionary

[Missing <param name="copyCache"/> documentation for "M:NHibernate.Type.IType.Replace(System.Object,System.Object,NHibernate.Engine.ISessionImplementor,System.Object,System.Collections.IDictionary,NHibernate.Type.ForeignKeyDirection)"]

foreignKeyDirection
Type: NHibernate.Type..::..ForeignKeyDirection

[Missing <param name="foreignKeyDirection"/> documentation for "M:NHibernate.Type.IType.Replace(System.Object,System.Object,NHibernate.Engine.ISessionImplementor,System.Object,System.Collections.IDictionary,NHibernate.Type.ForeignKeyDirection)"]

Return Value

the value to be merged

See Also