Hi.
I am trying to find some easy way to offer graph rollback functionality and one possible way which offers itself is XML serialization/deserialization.
But I would also like to maintain current references in the application so I thought it would be usefull if I could just read values from XML file into the existing entities.
Adding Context to the entity seems like a way to go except the context is not used during deserialization. If I read the same XML into the same entity twice, I get unique instances in the Context but all entities are added to the collection twice:
Context context = new Context(true);
SchemaEntity test = new SchemaEntity();
context.Add(test);
XmlReader reader = XmlReader.Create("e:\\temp\\pilot\\data\\subject.xml");
reader.MoveToContent();
test.ReadXml(reader, XmlFormatAspect.Compact25);
reader.Close();
int count = test.SchemaFields.Count; // = 3
XmlReader reader = XmlReader.Create("e:\\temp\\pilot\\data\\subject.xml");
reader.MoveToContent();
test.ReadXml(reader, XmlFormatAspect.Compact25);
reader.Close();
int count2 = test.SchemaFields.Count; // = 6
int totalCount = context.GetAllTypes().Count; // = 7
Am I missing something obvious or it's just a wrong way to go?
Also, while I was at it, I was playing with ObjectGraphUtils class. It seems like a really usefull one, but for the love of God I couldn't find a purpose of ProduceAdjacencyLists method.
I am using LLBLGen v. 2.5.07.1219
Thanks
Jakub