Hide

YetaWF.DataProvider.SQLDyn Package Documentation

Display
Print

YetaWF.DataProvider.SQL.SQLBase.Direct_QueryAsync Method

Executes the provided SQL statement(s).

Class: YetaWF.DataProvider.SQL.SQLBase
Namespace: YetaWF.DataProvider.SQL
Assembly: YetaWF.DataProvider.SQLDyn

Syntax

public Task<TYPE?> Direct_QueryAsync<TYPE>( string sql );
public Task Direct_QueryAsync( string sql );
public Task<TYPE?> Direct_QueryAsync<TYPE>(
    string sql,
    params object[] args );
public Task Direct_QueryAsync(
    string sql,
    params object[] args );

Parameters

sql

The SQL statement(s).

args

Optional arguments that are passed when executing the SQL statements.

Return Value

Some forms of this method return an object of type TYPE.

Remarks

This is used by application data providers to build and execute complex queries that are not possible with the standard data providers. Use of this method limits the application data provider to SQL repositories.

When using arguments, they are referenced in the SQL statement(s) sql using @p1, @p2, etc. where @p1 is replaced by the first optional argument. SQL injection attacks are not possible when using parameters.

See Also YetaWF.DataProvider.SQL.SQLBase ClassYetaWF.DataProvider.SQLDynYetaWF.Core