IDBContext.ExecuteObjectAsync<T> Method

Relativity API
Asynchronously executes a call to SQL and presents the resultant IDataReader to the supplied converter.

Namespace:  Relativity.API
Assembly:  Relativity.API (in Relativity.API.dll) Version: 640db774aa42dfbe1785add27fbb41844ec5c7d4
Syntax

Task<T> ExecuteObjectAsync<T>(
	IQuery query,
	Func<IDataReader, CancellationToken, Task<T>> converter
)

Parameters

query
Type: Relativity.API.Context.IQuery
the IQuery settings to present to the call to the SQL database.
converter
Type: System.Func<IDataReader, CancellationToken, Task<T>>
An asynchronous delegate used to convert the contents of a data reader into an object of type T

Type Parameters

T
The type to be returned by the converter

Return Value

Type: Task<T>
the output of the converter
Remarks

The reader is initialized with a call to Read (or ReadAsync where applicable). If the reader is null or the Read/ReadAsync returns false, the reader is not fed to the converter
See Also

Reference