LLBLGen 3.1.11.415.
I have collections for which I am using a RemovedEntitiesTracker. Sometimes an entity is removed from a collection but subsequently re-added to the collection. In this case I remove the entity from the RemovedEntitiesTracker.
However, I find that when the object graph is serialized, things don't work correctly for entities that have been added to a RemovedEntitiesTracker at some point--the entities relations are not serialized.
The attached project demonstrates this. I have three entities: EntityA, EntityB, and EntityC.
EntityA has a collection of EntityBs and EntityB has a collection of EntityCs.
I fetch an EntityA that has an EntityB that has an EntityC. If I serialize this, everything serializes correctly (EntityA, its EntityB, and its EntityC).
If I remove an EntityB from EntityA's EntityB collection, then add it back, and then serialize EntityA, it works correctly again:
//Remove the EntityB and then re-add it
EntityBEntity entityB = entityA.EntityBs[0];
entityA.EntityBs.RemoveAt(0);
entityA.EntityBs.Add(entityB);
But if I use a RemovedEntitiesTracker, it breaks:
//Remove the EntityB and then re-add it, but using a RemovedEntitiesTracker
entityA.EntityBs.RemovedEntitiesTracker = new EntityCollection();
entityB = entityA.EntityBs[0];
entityA.EntityBs.RemoveAt(0);
entityA.EntityBs.Add(entityB);
entityA.EntityBs.RemovedEntitiesTracker.Remove(entityB);
In this last case, when I serialize EntityA, it serializes the EntityB, but none of EntityB's relations get serialized.
Is this intentional for some reason?