Пример #1
0
 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)
                    )
                ));
 }
Пример #2
0
 public static async Task <T> ExecuteScalarAsync <T>(this IDAC dac, string query)
 {
     return(await Task.Run(() => dac.ExecuteScalar <T>(query)));
 }
Пример #3
0
 public static T ExecuteScalar <T>(this IDAC dac, string query)
 {
     return(Tools.Object.ChangeType <T>(dac.ExecuteScalar(query)));
 }
Пример #4
0
 public virtual object ExecuteScalar(string query)
 {
     return(DecoratedDAC.ExecuteScalar(query));
 }