示例#1
0
 protected DeleteCommandExpression UpdateDelete(DeleteCommandExpression delete, IdentifiableExpression table, Expression where)
 {
     if (table != delete.Identifiable || where != delete.Where)
     {
         return new DeleteCommandExpression(table, where);
     }
     return delete;
 }
示例#2
0
 protected virtual Expression VisitDelete(DeleteCommandExpression delete)
 {
     var table = (IdentifiableExpression)this.Visit(delete.Identifiable);
     var where = this.Visit(delete.Where);
     return this.UpdateDelete(delete, table, where);
 }
示例#3
0
            protected override Expression VisitDelete(DeleteCommandExpression delete)
            {
                if (delete.Identifiable.Entity.EntityType.Implements<IThing>())
                {
                    this.Write("DELETE Vertex ");
                }
                else if (delete.Identifiable.Entity.EntityType.Implements<IAssociation>())
                {
                    this.Write("DELETE Edge ");
                }
                else throw new NotSupportedException("Only Association and Thing types are supported.");

                bool saveHideIdentifiable = this.HideIdentifiableAliases;
                bool saveHideField = this.HideFieldAliases;
                this.HideIdentifiableAliases = true;
                this.HideFieldAliases = true;
                this.VisitSource(delete.Identifiable);
                if (delete.Where != null)
                {
                    this.WriteLine(Indentation.Same);
                    this.Write("WHERE ");
                    this.VisitPredicate(delete.Where);
                }
                this.HideIdentifiableAliases = saveHideIdentifiable;
                this.HideFieldAliases = saveHideField;
                return delete;
            }
示例#4
0
 protected override Expression VisitDelete(DeleteCommandExpression delete)
 {
     this.Write("DELETE FROM ");
     bool saveHideIdentifiable = this.HideIdentifiableAliases;
     bool saveHideField = this.HideFieldAliases;
     this.HideIdentifiableAliases = true;
     this.HideFieldAliases = true;
     this.VisitSource(delete.Identifiable);
     if (delete.Where != null)
     {
         this.WriteLine(Indentation.Same);
         this.Write("WHERE ");
         this.VisitPredicate(delete.Where);
     }
     this.HideIdentifiableAliases = saveHideIdentifiable;
     this.HideFieldAliases = saveHideField;
     return delete;
 }
示例#5
0
 protected virtual bool CompareDelete(DeleteCommandExpression x, DeleteCommandExpression y)
 {
     return this.Compare(x.Identifiable, y.Identifiable) && this.Compare(x.Where, y.Where);
 }