public static long GetMaxID(this IDAC dac, string tableName, string idColName) { return(dac.ExecuteScalar <long>( dac.QuickString( "SELECT MAX(T.ID) FROM (SELECT {0} ID FROM {1} WHERE ID IS NOT NULL UNION SELECT 0 ID ) T", SQLBuilderCommand.ColumnName(idColName), SQLBuilderCommand.TableName(tableName) ) )); }
public static async Task <T> ExecuteScalarAsync <T>(this IDAC dac, string query) { return(await Task.Run(() => dac.ExecuteScalar <T>(query))); }
public static T ExecuteScalar <T>(this IDAC dac, string query) { return(Tools.Object.ChangeType <T>(dac.ExecuteScalar(query))); }
public virtual object ExecuteScalar(string query) { return(DecoratedDAC.ExecuteScalar(query)); }