protected virtual Expression VisitDelete(DbDeleteCommand delete)
        {
            var table = this.Visit(delete.Table) as DbTableExpression;

            var where = this.Visit(delete.Where);

            return(this.UpdateDelete(delete, table, where));
        }
        protected DbDeleteCommand UpdateDelete(DbDeleteCommand delete, DbTableExpression table, Expression where)
        {
            if (table != delete.Table || where != delete.Where)
            {
                return(new DbDeleteCommand(table, where));
            }

            return(delete);
        }
Exemple #3
0
        protected override Expression VisitDelete(DbDeleteCommand delete)
        {
            this.Write("DELETE FROM ");

            var saveHideTable  = this.HideTableAliases;
            var saveHideColumn = this.HideColumnAliases;

            this.HideTableAliases  = true;
            this.HideColumnAliases = true;

            this.VisitSource(delete.Table);

            if (delete.Where != null)
            {
                this.WriteLine(Indentation.Same);
                this.Write("WHERE ");
                this.VisitPredicate(delete.Where);
            }

            this.HideTableAliases  = saveHideTable;
            this.HideColumnAliases = saveHideColumn;

            return(delete);
        }
 protected virtual bool CompareDelete(DbDeleteCommand x, DbDeleteCommand y)
 {
     return(this.Compare(x.Table, y.Table) && this.Compare(x.Where, y.Where));
 }
 protected override Expression VisitDelete(DbDeleteCommand delete)
 {
     return(this.BuildExecuteCommand(delete));
 }