I have a web service that has an input object similar to the following.
public class MyInput
{
[System.Xml.Serialization.XmlArrayItem("Demographic")]
public DemographicsInfo[] Demographics {get; set;}
}
With the definition of the DemographicsInfo class like this.
public class DemographicsInfo
{
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Name { get; set; }
public string Value { get; set; }
}
Right now this generates an XML structure like this.
<Demographics>
<Demographic Name="String">
<value>string</value>
</Demographic>
<Demographic Name="String">
<value>string</value>
</Demographic>
</Demographics>
I need to get it into this
<Demographics>
<Demographic Name="String">string</Demographic>
<Demographic Name="String">string</Demographic>
</Demographics>
For the life of me, I cannot seem to find the proper attribute(s) to apply to get this format. Does anyone have any advice?