Method SingleOrDefaultAsync
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
SingleOrDefaultAsync(CancellationToken)
Asynchronously reads the only mapped row.
public ValueTask<T?> SingleOrDefaultAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels the call, together with the cancellation token set on the underlying command: either one cancels it, whether it is opening the connection, looking up stored-procedure parameter names, executing or reading.
Returns
Exceptions
- OperationCanceledException
The operation was canceled.
- InvalidOperationException
The query returns more than one row.
- See Also
-
SingleOrDefault<T>(MappedQuery<T>)