Click or drag to resize
DaoBaseFetchScalarQueryAsyncT Method (CancellationToken, ITransaction, String, Object)
Async variant of FetchScalarQueryT(ITransaction, String, Object). Executes the specified plain SQL query using this DAO and returns the first scalar value returned as an instance of T. Every parameter value is converted into one or more parameters which have to be pre-defined in the sqlQuery. Uses default fetch aspects.

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.3.0.0 (5.3.0)
Syntax
public Task<T> FetchScalarQueryAsync<T>(
	CancellationToken cancellationToken,
	ITransaction containingTransaction,
	string sqlQuery,
	Object parameterValues = null
)

Parameters

cancellationToken
Type: System.ThreadingCancellationToken
the cancellationToken
containingTransaction
Type: SD.LLBLGen.Pro.ORMSupportClassesITransaction
A containing transaction if caller is added to a transaction, or null of not.
sqlQuery
Type: SystemString
The SQL query to execute, which returns a scalar value. Should contain parameter names for the parameter values, or placeholders for parameter sets. See documentation for details regarding format specifics.
parameterValues (Optional)
Type: SystemObject
The object containing the parameter values to use in the query. If it's an object array, parameters using ordening are assumed, otherwise for each public, non-static property, a parameter is created.

Type Parameters

T
The type of the scalar value to return.

Return Value

Type: TaskT
The first scalar value returned by the query as an instance of T or null if the query returned a NULL.

Implements

IDaoFetchScalarQueryAsyncT(CancellationToken, ITransaction, String, Object)
See Also