Assuming the following model
public class MyObject
{
public string Name { get; set; }
public ICollection<MyObjectItem> Items { get; set; }
}
public class MyObjectItem
{
public string Name { get; set; }
public int Total { get; set; }
}
I want to serialize and deserialize this object graph to a list of key/value pair of strings like :
MyObject.Name - "Name"
MyObject.Items.0.Name - "Name1"
MyObject.Items.0.Total - "10"
MyObject.Items.1.Name - "Name2"
MyObject.Items.1.Total - "20"