internal static Task <List <T> > WhereAsync <T>(this IDbCommand dbCmd, object anonType, CancellationToken token) { dbCmd.SetFilters <T>(anonType); return(OrmLiteReadCommandExtensions.IsScalar <T>() ? dbCmd.ColumnAsync <T>(null, token) : dbCmd.ConvertToListAsync <T>(null, token)); }
internal static Task <T> SingleAsync <T>(this IDbCommand dbCmd, string sql, object anonType, CancellationToken token) { if (OrmLiteReadCommandExtensions.IsScalar <T>()) { return(dbCmd.ScalarAsync <T>(sql, anonType, token)); } dbCmd.SetParameters <T>(anonType, excludeDefaults: false); return(dbCmd.ConvertToAsync <T>(dbCmd.GetDialectProvider().ToSelectStatement(typeof(T), sql), token)); }
internal static Task <List <T> > SqlColumnAsync <T>(this IDbCommand dbCmd, string sql, Dictionary <string, object> dict, CancellationToken token) { if (dict != null) { dbCmd.SetParameters(dict, false); } dbCmd.CommandText = sql; return(OrmLiteReadCommandExtensions.IsScalar <T>() ? dbCmd.ColumnAsync <T>(null, token) : dbCmd.ConvertToListAsync <T>(null, token)); }
internal static Task <List <T> > SqlColumnAsync <T>(this IDbCommand dbCmd, string sql, object anonType, CancellationToken token) { if (anonType != null) { dbCmd.SetParameters <T>(anonType, excludeDefaults: false); } dbCmd.CommandText = sql; return(OrmLiteReadCommandExtensions.IsScalar <T>() ? dbCmd.ColumnAsync <T>(null, token) : dbCmd.ConvertToListAsync <T>(null, token)); }
internal static Task <List <T> > SelectAsync <T>(this IDbCommand dbCmd, string sql, object anonType, CancellationToken token) { if (anonType != null) { dbCmd.SetParameters <T>(anonType, excludeDefaults: false); } dbCmd.CommandText = dbCmd.GetDialectProvider().ToSelectStatement(typeof(T), sql); return(OrmLiteReadCommandExtensions.IsScalar <T>() ? dbCmd.ColumnAsync <T>(null, token) : dbCmd.ConvertToListAsync <T>(null, token)); }
internal static Task <List <T> > SelectAsync <T>(this IDbCommand dbCmd, string sql, Dictionary <string, object> dict, CancellationToken token) { if (dict != null) { dbCmd.SetParameters((IDictionary <string, object>)dict, (bool)false); } dbCmd.CommandText = dbCmd.GetDialectProvider().ToSelectStatement(typeof(T), sql); return(OrmLiteReadCommandExtensions.IsScalar <T>() ? dbCmd.ColumnAsync <T>(null, token) : dbCmd.ConvertToListAsync <T>(null, token)); }