Exemplo n.º 1
0
        public override void BuildCommand(DbCommand command)
        {
            // TODO: handle_commandTree.Parameters
            InsertExpression insert = new InsertExpression();

            _projectVarName.Push(_commandTree.Target.VariableName);
            insert.AppendTarget(_commandTree.Target.Expression.Accept(this));
            List <VisitedExpression> columns = new List <VisitedExpression>();
            List <VisitedExpression> values  = new List <VisitedExpression>();

            foreach (DbSetClause clause in _commandTree.SetClauses)
            {
                columns.Add(clause.Property.Accept(this));
                values.Add(clause.Value.Accept(this));
            }
            insert.AppendColumns(columns);
            insert.AppendValues(values);
            if (_commandTree.Returning != null)
            {
                _processingReturning       = true;
                insert.ReturningExpression = _commandTree.Returning.Accept(this);
            }
            _projectVarName.Pop();
            command.CommandText = insert.ToString();
        }
 public override void BuildCommand(DbCommand command)
 {
     // TODO: handle_commandTree.Parameters
     InsertExpression insert = new InsertExpression();
     _tableName = _commandTree.Target.VariableName;
     insert.AppendTarget(_commandTree.Target.Expression.Accept(this));
     List<VisitedExpression> columns = new List<VisitedExpression>();
     List<VisitedExpression> values = new List<VisitedExpression>();
     foreach (DbSetClause clause in _commandTree.SetClauses)
     {
         columns.Add(clause.Property.Accept(this));
         values.Add(clause.Value.Accept(this));
     }
     insert.AppendColumns(columns);
     insert.AppendValues(values);
     if (_commandTree.Returning != null)
     {
         insert.AppendReturning(_commandTree.Returning as DbNewInstanceExpression);
     }
     _tableName = null;
     command.CommandText = insert.ToString();
 }
Exemplo n.º 3
0
 public override void BuildCommand(DbCommand command)
 {
     // TODO: handle_commandTree.Parameters
     InsertExpression insert = new InsertExpression();
     _projectVarName.Push(_commandTree.Target.VariableName);
     insert.AppendTarget(_commandTree.Target.Expression.Accept(this));
     List<VisitedExpression> columns = new List<VisitedExpression>();
     List<VisitedExpression> values = new List<VisitedExpression>();
     foreach (DbSetClause clause in _commandTree.SetClauses)
     {
         columns.Add(clause.Property.Accept(this));
         values.Add(clause.Value.Accept(this));
     }
     insert.AppendColumns(columns);
     insert.AppendValues(values);
     if (_commandTree.Returning != null)
     {
         _processingReturning = true;
         insert.ReturningExpression = _commandTree.Returning.Accept(this);
     }
     _projectVarName.Pop();
     command.CommandText = insert.ToString();
 }
Exemplo n.º 4
0
        public override void BuildCommand(DbCommand command)
        {
            // TODO: handle_commandTree.Parameters
            InsertExpression insert = new InsertExpression();

            _tableName = _commandTree.Target.VariableName;
            insert.AppendTarget(_commandTree.Target.Expression.Accept(this));
            List <VisitedExpression> columns = new List <VisitedExpression>();
            List <VisitedExpression> values  = new List <VisitedExpression>();

            foreach (DbSetClause clause in _commandTree.SetClauses)
            {
                columns.Add(clause.Property.Accept(this));
                values.Add(clause.Value.Accept(this));
            }
            insert.AppendColumns(columns);
            insert.AppendValues(values);
            if (_commandTree.Returning != null)
            {
                insert.AppendReturning(_commandTree.Returning as DbNewInstanceExpression);
            }
            _tableName          = null;
            command.CommandText = insert.ToString();
        }