I ran into the problem of writing an object persistence mechanism that serializes / deserializes an SQL database and XML files.
To illustrate, suppose I have a graph of objects with a single root object. It can be, for example, a βtreeβ that has all kinds of child objects - leaves, branches, nuts, squirrels, birds, etc.
I need a proposal for an architecture that easily moves between loading and saving a βtreeβ from a file and / or database. It should be able to load the "tree" from the file and save it in the database or vice versa.
I am currently using the Entity Framework for my persistence of SQL, and I am quite satisfied with this. For XML, I use XDocument, which I also really like, but I wonder if there is some kind of structure that already does all this.
source share