Extending the AndSelect to take an param array of fields
This commit is contained in:
@@ -660,6 +660,18 @@ namespace Umbraco.Core.Persistence
|
||||
return sql.Select(sql.GetColumns(tableAlias: tableAlias, columnExpressions: fields));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds columns to a SELECT Sql statement.
|
||||
/// </summary>
|
||||
/// <param name="sql">The origin sql.</param>
|
||||
/// <param name="fields">Expression indicating the column to select.</param>
|
||||
/// <returns>The Sql statement.</returns>
|
||||
public static Sql<ISqlContext> AndSelect(this Sql<ISqlContext> sql, params string[] fields)
|
||||
{
|
||||
if (sql == null) throw new ArgumentNullException(nameof(sql));
|
||||
return sql.Append(", " + string.Join(", ", fields));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds columns to a SELECT Sql statement.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user