public static SqlRequest InvokeScalarFunction(this IDbTest test, string functionName, string schema = null, params SqlParameter[] parameters) { var sql = new StringBuilder($"Select {(!string.IsNullOrEmpty(schema) ? $"{schema}." : "")}{functionName}("); var firstParam = true; foreach (var p in parameters) { if (firstParam) { firstParam = false; } else { sql.Append(", "); } sql.Append(p.ParameterName); } sql.Append(") as RetVal"); return(SqlRequest.RunSqlText(sql.ToString(), parameters)); }
public static SqlRequest RunSqlText(this IDbTest test, string sql = null, params SqlParameter[] parameters) { return(SqlRequest.RunSqlText(sql, parameters)); }