SqlHelperMergeColumns Method (IEnumerableString, IEnumerableString, FuncString, String, Boolean, FuncString, String) |
Merges the sets of columns and makes sure that each column in the result is present only once.
Namespace: CMS.DataEngineAssembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 12.0.0
Syntax public static string MergeColumns(
IEnumerable<string> columns,
IEnumerable<string> addColumns = null,
Func<string, string> uniqueKey = null,
bool extraColumns = true,
Func<string, string> transformation = null
)
Parameters
- columns
- Type: System.Collections.GenericIEnumerableString
Original column list - addColumns (Optional)
- Type: System.Collections.GenericIEnumerableString
List of columns to add - uniqueKey (Optional)
- Type: SystemFuncString, String
Function which provides unique key for the merging process (if two column keys match, the merging process allows only first column) - extraColumns (Optional)
- Type: SystemBoolean
Indicates if columns which are not part of '*' expression are merged to the existing list of columns - transformation (Optional)
- Type: SystemFuncString, String
Column transformation
Return Value
Type:
StringReturns the list separated by dashes for use in SQL query
See Also