Not sure what you are asking. Are you looking for a combination of object and collection initialization?
RootObject robj = new RootObject()
{
inchistory = new List<Inchistory>()
{
new Inchistory()
{
r = "foo",
reference = "bar",
customerinfo = new CustomerInfo()
{
customername = "joe blogs",
address = "somewhere",
postcode = "xxx xxxx"
},
region = "somewhere"
},
new Inchistory()
{
// etc
}
}
};
Or if you don't have things to add right now, you can just do:
RootObject robj = new RootObject()
{
inchistory = new List<Inchistory>()
};
Or you could actually initialize the list inside the class constructor as David suggested.