internal static ProjectedColumns ProjectColumns(Nominator nominator, Expression expression, IEnumerable<SqlColumnDeclaration> existingColumns, string newAlias, IEnumerable<string> existingAliases) { var projector = new ColumnProjector(nominator, expression, existingColumns, newAlias, existingAliases); expression = projector.Visit(expression); return new ProjectedColumns(expression, projector.columns.ToReadOnlyCollection()); }
internal static ProjectedColumns ProjectColumns(Nominator nominator, Expression expression, IEnumerable <SqlColumnDeclaration> existingColumns, string newAlias, IEnumerable <string> existingAliases) { var projector = new ColumnProjector(nominator, expression, existingColumns, newAlias, existingAliases); expression = projector.Visit(expression); return(new ProjectedColumns(expression, projector.columns.ToReadOnlyCollection())); }
internal ColumnProjector(TypeDescriptorProvider typeDescriptorProvider, Nominator nominator, Expression expression, string newAlias, params string[] existingAliases) { columnNames = new HashSet <string>(); columns = new List <SqlColumnDeclaration>(); mappedColumnExpressions = new Dictionary <SqlColumnExpression, SqlColumnExpression>(); this.typeDescriptorProvider = typeDescriptorProvider; this.nominator = nominator; this.newAlias = newAlias; this.existingAliases = existingAliases; this.candidates = nominator.Nominate(expression); }
internal ColumnProjector(Nominator nominator, Expression expression, IEnumerable<SqlColumnDeclaration> existingColumns, string newAlias, IEnumerable<string> existingAliases) { this.mappedColumnExpressions = new Dictionary<SqlColumnExpression, SqlColumnExpression>(); if (existingColumns != null) { this.columns = new List<SqlColumnDeclaration>(existingColumns); this.columnNames = new HashSet<string>(this.columns.Select(c => c.Name)); } else { this.columns = new List<SqlColumnDeclaration>(); this.columnNames = new HashSet<string>(); } this.newAlias = newAlias; this.existingAliases = existingAliases.ToArray(); this.candidates = nominator.Nominate(expression); }
internal ColumnProjector(Nominator nominator, Expression expression, IEnumerable <SqlColumnDeclaration> existingColumns, string newAlias, IEnumerable <string> existingAliases) { this.mappedColumnExpressions = new Dictionary <SqlColumnExpression, SqlColumnExpression>(); if (existingColumns != null) { this.columns = new List <SqlColumnDeclaration>(existingColumns); this.columnNames = new HashSet <string>(this.columns.Select(c => c.Name)); } else { this.columns = new List <SqlColumnDeclaration>(); this.columnNames = new HashSet <string>(); } this.newAlias = newAlias; this.existingAliases = existingAliases.ToArray(); this.candidates = nominator.Nominate(expression); }
public static ProjectedColumns ProjectColumns(TypeDescriptorProvider typeDescriptorProvider, Nominator nominator, Expression expression, string newAlias, params string[] existingAliases) { var projector = new ColumnProjector(typeDescriptorProvider, nominator, expression, newAlias, existingAliases); expression = projector.Visit(expression); return(new ProjectedColumns(expression, projector.columns.ToReadOnlyList())); }