ExecuteScalarAsTypeAsync Method
Definition
ExecuteScalarAsTypeAsync(DataStatement, Type, Action<ObjectFormattingOptions>, CancellationToken)
Asynchronously executes the command statement, and attempts to convert the first column of the first row in the result set to the specified returnType.
Additional columns or rows are ignored.
public virtual Task<object> ExecuteScalarAsTypeAsync(DataStatement statement, Type returnType, Action<ObjectFormattingOptions> setup = null, CancellationToken ct = default)
Parameters
statementDataStatementThe command statement to execute.
returnTypeTypeThe type to return the first column value as.
setupAction<ObjectFormattingOptions>The ObjectFormattingOptions which may be configured.
ctCancellationTokenA token to cancel the asynchronous operation.