예제 #1
0
 internal override SqlExpression VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc)
 {
     foreach (SqlColumn c in fc.Columns)
     {
         c.Alias = this.alias;
     }
     return(base.VisitTableValuedFunctionCall(fc));
 }
예제 #2
0
 internal override SqlExpression VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc)
 {
     foreach (SqlColumn col in fc.Columns)
     {
         this.VisitColumn(col);
     }
     return(fc);
 }
예제 #3
0
        internal override SqlAlias VisitAlias(SqlAlias a)
        {
            SqlTable tab = a.Node as SqlTable;
            SqlTableValuedFunctionCall tvf = a.Node as SqlTableValuedFunctionCall;

            if (this.addPrimaryKeys && (tab != null || tvf != null))
            {
                List <SqlOrderExpression> list = new List <SqlOrderExpression>();

                bool     isTable = tab != null;
                MetaType rowType = isTable ? tab.RowType : tvf.RowType;
                foreach (MetaDataMember mm in rowType.IdentityMembers)
                {
                    string           name = mm.MappedName;
                    SqlColumn        col;
                    Expression       sourceExpression;
                    List <SqlColumn> columns;

                    if (isTable)
                    {
                        col = tab.Find(name);
                        sourceExpression = tab.SourceExpression;
                        columns          = tab.Columns;
                    }
                    else
                    {
                        col = tvf.Find(name);
                        sourceExpression = tvf.SourceExpression;
                        columns          = tvf.Columns;
                    }

                    if (col == null)
                    {
                        col       = new SqlColumn(mm.MemberAccessor.Type, typeProvider.From(mm.MemberAccessor.Type), name, mm, null, sourceExpression);
                        col.Alias = a;
                        columns.Add(col);
                    }
                    list.Add(new SqlOrderExpression(SqlOrderType.Ascending, new SqlColumnRef(col)));
                }

                this.PrependOrderExpressions(list);

                return(a);
            }
            else
            {
                return(base.VisitAlias(a));
            }
        }
예제 #4
0
 internal override SqlExpression VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc)
 {
     foreach (SqlColumn c in fc.Columns)
     {
         if (c == this.match)
         {
             if (this.found != null)
             {
                 throw Error.ColumnIsDefinedInMultiplePlaces(GetColumnName(this.match));
             }
             this.found = c;
             break;
         }
     }
     return(fc);
 }
        internal override SqlExpression VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc)
        {
            SqlExpression[] args = new SqlExpression[fc.Arguments.Count];
            for (int i = 0, n = fc.Arguments.Count; i < n; i++)
            {
                args[i] = this.VisitExpression(fc.Arguments[i]);
            }
            SqlTableValuedFunctionCall nfc = new SqlTableValuedFunctionCall(fc.RowType, fc.ClrType, fc.SqlType, fc.Name, args, fc.SourceExpression);

            this.nodeMap[fc] = nfc;
            foreach (SqlColumn c in fc.Columns)
            {
                nfc.Columns.Add((SqlColumn)this.Visit(c));
            }
            return(nfc);
        }
예제 #6
0
 internal override SqlExpression VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
     // both scalar and table valued functions are formatted the same
     return VisitFunctionCall(fc);
 }
예제 #7
0
 internal override SqlExpression VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
     foreach(SqlColumn col in fc.Columns) {
         this.VisitColumn(col);
     }
     return fc;
 }
예제 #8
0
 internal virtual SqlExpression VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
     for (int i = 0, n = fc.Arguments.Count; i < n; i++) {
         fc.Arguments[i] = this.VisitExpression(fc.Arguments[i]);
     }
     return fc;
 }
예제 #9
0
 internal override SqlExpression VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
     SqlExpression[] args = new SqlExpression[fc.Arguments.Count];
     for (int i = 0, n = fc.Arguments.Count; i < n; i++) {
         args[i] = this.VisitExpression(fc.Arguments[i]);
     }
     SqlTableValuedFunctionCall nfc = new SqlTableValuedFunctionCall(fc.RowType, fc.ClrType, fc.SqlType, fc.Name, args, fc.SourceExpression);
     this.nodeMap[fc] = nfc;
     foreach (SqlColumn c in fc.Columns) {
         nfc.Columns.Add((SqlColumn)this.Visit(c));
     }
     return nfc;
 }
예제 #10
0
 protected override SqlExpression VisitTableValuedFunction(
     SqlTableValuedFunctionCall expr)
 {
     return expr;
 }
예제 #11
0
 protected virtual SqlExpression VisitTableValuedFunction(
     SqlTableValuedFunctionCall expr)
 {
     return(expr);
 }
예제 #12
0
 protected override SqlExpression VisitTableValuedFunction(
     SqlTableValuedFunctionCall expr)
 {
     return(expr);
 }
예제 #13
0
 internal virtual SqlExpression VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
     for (int i = 0, n = fc.Arguments.Count; i < n; i++) {
         fc.Arguments[i] = this.VisitExpression(fc.Arguments[i]);
     }
     return fc;
 }
예제 #14
0
 internal override SqlExpression VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
     foreach (SqlColumn c in fc.Columns) {
         if (c == this.match) {
             if (this.found != null)
                 throw Error.ColumnIsDefinedInMultiplePlaces(GetColumnName(this.match));
             this.found = c;
             break;
         }
     }
     return fc;
 }
예제 #15
0
 internal override SqlExpression VisitTableValuedFunctionCall(SqlTableValuedFunctionCall fc) {
     foreach (SqlColumn c in fc.Columns) {
         c.Alias = this.alias;
     }
     return base.VisitTableValuedFunctionCall(fc);
 }
예제 #16
0
 protected virtual SqlExpression VisitTableValuedFunction(
     SqlTableValuedFunctionCall expr)
 {
     return expr;
 }