public override void BuildCommand(DbCommand command) { // TODO: handle _commandTree.Returning and _commandTree.Parameters UpdateExpression update = new UpdateExpression(); _projectVarName.Push(_commandTree.Target.VariableName); update.AppendTarget(_commandTree.Target.Expression.Accept(this)); foreach (DbSetClause clause in _commandTree.SetClauses) { update.AppendSet(clause.Property.Accept(this), clause.Value.Accept(this)); } if (_commandTree.Predicate != null) { update.AppendWhere(_commandTree.Predicate.Accept(this)); } _projectVarName.Pop(); command.CommandText = update.ToString(); }
public override void BuildCommand(DbCommand command) { // TODO: handle _commandTree.Parameters UpdateExpression update = new UpdateExpression(); _tableName = _commandTree.Target.VariableName; update.AppendTarget(_commandTree.Target.Expression.Accept(this)); foreach (DbSetClause clause in _commandTree.SetClauses) { update.AppendSet(clause.Property.Accept(this), clause.Value.Accept(this)); } if (_commandTree.Predicate != null) { update.AppendWhere(_commandTree.Predicate.Accept(this)); } if (_commandTree.Returning != null) { update.AppendReturning((DbNewInstanceExpression)_commandTree.Returning); } _tableName = null; command.CommandText = update.ToString(); }