Associate the proxy with the given session. Care should be given to make certain that the proxy is added to the session's persistence context as well to maintain the symmetry of the association. That must be done seperately as this method simply sets an internal reference. We do also check that if there is already an associated session that the proxy reference was removed from that previous session's persistence context.

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

Syntax

C#
public void SetSession(
	ISessionImplementor s
)
Visual Basic
Public Sub SetSession ( _
	s As ISessionImplementor _
)
Visual C++
public:
virtual void SetSession(
	ISessionImplementor^ s
) sealed

Parameters

s
Type: NHibernate.Engine..::..ISessionImplementor
The session

Implements

ILazyInitializer..::..SetSession(ISessionImplementor)

See Also