Wrapping Serialized Array Elements with the Name of the Array

前端 未结 2 377
滥情空心
滥情空心 2021-01-14 08:45

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 (\

2条回答
  •  孤城傲影
    2021-01-14 08:50

        ...
        [XmlArray(IsNullable = false)]
        [XmlArrayItem("MyInnerObjectProperties")]
        public MyObject[] MyObjectProperty
        {
            get
            {
                return _myObjectProperty;
            }
            set
            {
                _myObjectProperty = value;
            }
        }
        ...
    

提交回复
热议问题