/// <summary> /// Selects from tables. /// </summary> /// <param name="tables">The tables.</param> public void SelectFromTables(params string[] tables) { SelectedTables.Clear(); foreach (var table in tables) { SelectedTables.Add(table); } }
/// <inheritdoc /> public ISelectStringBuilder From(params string[] tableNames) { SelectedTables.Clear(); foreach (var table in tableNames) { SelectedTables.Add(table); } return(this); }
public void PutSelectedTable(string tableAlias, bool createNewPath) { if (SelectedTables == null) { SelectedTables = new List <List <string> >(); } if (SelectedTables.Count == 0) { List <string> path = new List <string>(); if (!string.IsNullOrWhiteSpace(tableAlias)) { path.Add(tableAlias); } SelectedTables.Add(path); } else { if (createNewPath) { List <string> path = new List <string>(); if (!string.IsNullOrWhiteSpace(tableAlias)) { path.Add(tableAlias); } SelectedTables.Add(path); } else { int index = SelectedTables.Count - 1; List <string> path = SelectedTables[index]; if (path == null) { path = new List <string>(); if (!string.IsNullOrWhiteSpace(tableAlias)) { path.Add(tableAlias); } } else { if (!string.IsNullOrWhiteSpace(tableAlias) && !BaseMarkupUtilities.IsExistOnList(path, tableAlias)) { // path.Insert(0, tableAlias); path.Add(tableAlias); } } SelectedTables[index] = path; } } }
/// <summary> /// Selects from table. /// </summary> /// <param name="table">The table.</param> public void SelectFromTable(string table) { SelectedTables.Clear(); SelectedTables.Add(table); }