Copy the state of the given object onto the persistent object with the same identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If the given instance is unsaved, save a copy of and return it as a newly persistent instance. The given instance does not become associated with the session. This operation cascades to associated instances if the association is mapped with cascade="merge".
The semantics of this method are defined by JSR-220. Name of the entity.a detached instance with state to be copied

Return Value

an updated persistent instance

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

Syntax

C#
T Merge<T>(
	string entityName,
	T entity
)
where T : class
Visual Basic
Function Merge(Of T As Class) ( _
	entityName As String, _
	entity As T _
) As T
Visual C++
generic<typename T>
where T : ref class
T Merge(
	String^ entityName, 
	T entity
)

Parameters

entityName
Type: System..::..String

[Missing <param name="entityName"/> documentation for "M:NHibernate.ISession.Merge``1(System.String,``0)"]

entity
Type: T

[Missing <param name="entity"/> documentation for "M:NHibernate.ISession.Merge``1(System.String,``0)"]

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:NHibernate.ISession.Merge``1(System.String,``0)"]

Return Value

[Missing <returns> documentation for "M:NHibernate.ISession.Merge``1(System.String,``0)"]

See Also