I am using VSTS2008 + C# + .Net 3.0. I am using below code to serialize XML, and my object contains array type property, and I want to add an additional elements\' layer (\
...
[XmlArray(IsNullable = false)]
[XmlArrayItem("MyInnerObjectProperties")]
public MyObject[] MyObjectProperty
{
get
{
return _myObjectProperty;
}
set
{
_myObjectProperty = value;
}
}
...
make use of the XmlArrayItemAttribute
[XmlArray("MyInnerObjectProperties")]
[XmlArrayItemAttribute("MyInnerObjectProperty", typeof(MyInnerObject), IsNullable = false)]
public MyInnerObject[] MyInnerObjectProperty
{
get
{
return _myInnerObjectProperty;
}
set
{
_myInnerObjectProperty = value;
}
}