Convenience method to return a single instance that matches the query, or null if the query returns no results.

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

Syntax

C#
Object UniqueResult()
Visual Basic
Function UniqueResult As Object
Visual C++
Object^ UniqueResult()

Return Value

the single result or nullNothingnullptra null reference (Nothing in Visual Basic)

Exceptions

ExceptionCondition
NHibernate..::..HibernateException If there is more than one matching result

See Also