Пример #1
0
 public override void BuildCommand(DbCommand command)
 {
     // TODO: handle _commandTree.Returning and _commandTree.Parameters
     DeleteExpression delete = new DeleteExpression();
     _tableName = _commandTree.Target.VariableName;
     delete.AppendFrom(_commandTree.Target.Expression.Accept(this));
     if (_commandTree.Predicate != null)
     {
         delete.AppendWhere(_commandTree.Predicate.Accept(this));
     }
     _tableName = null;
     command.CommandText = delete.ToString();
 }
        public override void BuildCommand(DbCommand command)
        {
            // TODO: handle _commandTree.Returning and _commandTree.Parameters
            DeleteExpression delete = new DeleteExpression();

            _projectVarName.Push(_commandTree.Target.VariableName);
            delete.AppendFrom(_commandTree.Target.Expression.Accept(this));
            if (_commandTree.Predicate != null)
            {
                delete.AppendWhere(_commandTree.Predicate.Accept(this));
            }
            _projectVarName.Pop();
            command.CommandText = delete.ToString();
        }