protected override void NodeDeletionChange(EntityChangeNodeDeletion item) { IEnumerable <EntityChangeDescriptor> temp = ChangeLog.Where(p => p.Entity == item.Entity).ToList(); if (!temp.Any() && item.Entity.EntityId == null) { throw new InvalidOperationException("Unable to locate entity. It must be tracked or have an EntityId."); } if (temp.Any(p => p is EntityChangeNodeCreation)) { ChangeLog.RemoveAll(p => temp.Contains(p)); } else { ChangeLog.RemoveAll(p => temp.Contains(p)); ChangeLog.Add(item); } foreach (EntityChangeRelCreation rel in ChangeLog.Where(p => p is EntityChangeRelCreation && (((EntityChangeRelCreation)p).Source == item.Entity || ((EntityChangeRelCreation)p).Destination == item.Entity)).ToList()) { RelDeletionChange(new EntityChangeRelDeletion(rel.Entity as IOgmConnection)); } }
protected abstract void NodeDeletionChange(EntityChangeNodeDeletion item);