In C# I wish to serialise a data structure where objects can belong to more than one collection.
For example, I have a Person class. I also have a Family class and School class, which each contain a MemberList. An instance of the Person class can be present in both the MemberList of the Family and the School.
I wish to serialise the entire data structure but am concerned that the instance of the Person class will end up being stored as two separate instances and upon deserialisation I will end up with two instances instead of one. Is the serialiser clever enough to store the data so that this will not happen? Is there any way to stop this happening if so?
Any help or suggestions appreciated.