public SqlTableSource(ISqlTableSource source, string? alias, IEnumerable<SqlJoinedTable> joins, IEnumerable<ISqlExpression[]>? uniqueKeys) { Source = source ?? throw new ArgumentNullException(nameof(source)); _alias = alias; if (joins != null) Joins.AddRange(joins); if (uniqueKeys != null) UniqueKeys.AddRange(uniqueKeys); }
internal void Init( SqlSelectClause select, SqlFromClause from, SqlWhereClause where, SqlGroupByClause groupBy, SqlWhereClause having, SqlOrderByClause orderBy, List <SqlSetOperator>?setOperators, List <ISqlExpression[]>?uniqueKeys, SelectQuery?parentSelect, bool parameterDependent, string?queryName, bool doNotSetAliases) { Select = select; From = from; Where = where; GroupBy = groupBy; Having = having; OrderBy = orderBy; _setOperators = setOperators; ParentSelect = parentSelect; IsParameterDependent = parameterDependent; QueryName = queryName; DoNotSetAliases = doNotSetAliases; if (uniqueKeys != null) { UniqueKeys.AddRange(uniqueKeys); } foreach (var col in select.Columns) { col.Parent = this; } Select.SetSqlQuery(this); From.SetSqlQuery(this); Where.SetSqlQuery(this); GroupBy.SetSqlQuery(this); Having.SetSqlQuery(this); OrderBy.SetSqlQuery(this); }