示例#1
0
        protected virtual Expression VisitUpdate(DbUpdateExpression update)
        {
            DbTableExpression table = (DbTableExpression)Visit(update.Table);

            Expression where = Visit(update.Where);
            ReadOnlyCollection <DbColumnAssignment> assignments =
                VisitColumnAssignments(update.Assignments);

            return(UpdateUpdate(update, table, where, assignments));
        }
示例#2
0
        protected DbUpdateExpression UpdateUpdate(DbUpdateExpression update,
                                                  DbTableExpression table, Expression where, IEnumerable <DbColumnAssignment> assignments)
        {
            if (table != update.Table || where != update.Where ||
                assignments != update.Assignments)
            {
                return(new DbUpdateExpression(table, where, assignments));
            }

            return(update);
        }
 protected DbUpdateExpression UpdateUpdate(DbUpdateExpression update, 
     DbTableExpression table, Expression where, IEnumerable<DbColumnAssignment> assignments)
 {
     if (table != update.Table || where != update.Where || 
         assignments != update.Assignments)
         return new DbUpdateExpression(table, where, assignments);
     
     return update;
 }
        protected virtual Expression VisitUpdate(DbUpdateExpression update)
        {
            DbTableExpression table = (DbTableExpression)Visit(update.Table);
            Expression where = Visit(update.Where);
            ReadOnlyCollection<DbColumnAssignment> assignments = 
                VisitColumnAssignments(update.Assignments);

            return UpdateUpdate(update, table, where, assignments);
        }
 protected virtual bool CompareUpdate(DbUpdateExpression x, DbUpdateExpression y)
 {
     return(Compare(x.Table, y.Table) && Compare(x.Where, y.Where) &&
            CompareColumnAssignments(x.Assignments, y.Assignments));
 }
示例#6
0
 protected override Expression VisitUpdate(DbUpdateExpression update)
 {
     return(this.BuildExecuteCommand(update));
 }
 protected override Expression VisitUpdate(DbUpdateExpression update)
 {
     this.Write("UPDATE ");
     this.WriteTableName(update.Table.Name);
     this.WriteLine(Indentation.Same);
     bool saveHide = this.HideColumnAliases;
     this.HideColumnAliases = true;
     this.Write("SET ");
     for (int i = 0, n = update.Assignments.Count; i < n; i++)
     {
         DbColumnAssignment ca = update.Assignments[i];
         if (i > 0) this.Write(", ");
         this.Visit(ca.Column);
         this.Write(" = ");
         this.Visit(ca.Expression);
     }
     if (update.Where != null)
     {
         this.WriteLine(Indentation.Same);
         this.Write("WHERE ");
         this.Visit(update.Where);
     }
     this.HideColumnAliases = saveHide;
     return update;
 }
 protected virtual bool CompareUpdate(DbUpdateExpression x, DbUpdateExpression y)
 {
     return Compare(x.Table, y.Table) && Compare(x.Where, y.Where) && 
         CompareColumnAssignments(x.Assignments, y.Assignments);
 }