public static TKey GetScalar <T, TKey>(this IDbCommand dbCmd, SqlExpressionVisitor <T> expression) where T : new() { string sql = expression.ToSelectStatement(); return(dbCmd.GetScalar <TKey>(sql)); }
public static T FirstOrDefault <T>(this IDbCommand dbCmd, SqlExpressionVisitor <T> expression) { string sql = expression.ToSelectStatement(); using (var dbReader = dbCmd.ExecReader(sql)) { return(ConvertTo <T>(dbReader)); } }
public static List <T> Select <T>(this IDbCommand dbCmd, SqlExpressionVisitor <T> expression) { string sql = expression.ToSelectStatement(); using (var reader = dbCmd.ExecReader(sql)) { return(ConvertToList <T>(reader)); } }