Convenience method to return a single instance that matches
the query, or null if the query returns no results.
Namespace: NHibernateAssembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)
Syntax
| C# |
|---|
TRoot SingleOrDefault() |
| Visual Basic |
|---|
Function SingleOrDefault As TRoot |
| Visual C++ |
|---|
TRoot SingleOrDefault() |
Return Value
the single result or nullNothingnullptra null reference (Nothing in Visual Basic)
Exceptions
| Exception | Condition |
|---|---|
| NHibernate..::..HibernateException | If there is more than one matching result |