Inheritance: SqlExpressionVisitor
コード例 #1
0
ファイル: ColumnProjector.cs プロジェクト: tumtumtum/Shaolinq
		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());
		}
コード例 #2
0
ファイル: ColumnProjector.cs プロジェクト: microtan/Shaolinq
        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()));
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: ColumnProjector.cs プロジェクト: tumtumtum/Shaolinq
		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);
		}
コード例 #5
0
ファイル: ColumnProjector.cs プロジェクト: microtan/Shaolinq
        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);
        }
コード例 #6
0
        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()));
        }