What I want to achieve is an XML output like:
<cars>
<car id="0">
<Type>1</Type>
<Class>B</Class>
</car>
<car id="1">
<Type>1</Type>
<Class>B</Class>
</car>
</cars>
All the car data is in seperate XML files. Part of the following code I can achieve reading this data into a dictionary using a car-model:
public Dictionary<int, ModelCar> Car { get; }
public Cars()
{
Car = new Dictionary<int, ModelCar>();
foreach (var File in Directory.GetFiles(Folder, "*.xml", SearchOption.TopDirectoryOnly))
{
ModelCar item = new ModelCar().DeserializeFile(File);
Car.Add(item.Id, item);
}
}
The problem is writing the dictionary 'Car' which holds all the car data to a combined XML output / input. Any hints / tutorial / example on how the model 'Cars' should look like and how to invoke?
Edit: Looking into this post now - https://stackoverflow.com/a/19600156/8333405