Method SingleOrDefault
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
SingleOrDefault<T>(IMappedQuery<T>)
Reads the only mapped row.
public static T? SingleOrDefault<T>(this IMappedQuery<T> query)
Parameters
queryIMappedQuery<T>The query to execute.
Returns
- T
The single row, or default if the query returns no rows.
Type Parameters
TThe type each row is mapped to.
Exceptions
- InvalidOperationException
The query returns more than one row.
- See Also
-
FirstOrDefault<T>(IMappedQuery<T>)