Obtains the current session.
Namespace: NHibernateAssembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)
Syntax
| C# |
|---|
ISession GetCurrentSession() |
| Visual Basic |
|---|
Function GetCurrentSession As ISession |
| Visual C++ |
|---|
ISession^ GetCurrentSession() |
Return Value
The current session.
Remarks
The definition of what exactly "current" means is controlled by the ICurrentSessionContext implementation configured for use.
Exceptions
| Exception | Condition |
|---|---|
| NHibernate..::..HibernateException | Indicates an issue locating a suitable current session. |