The problem is that I' not getting the structure of XML that I want. My Code is as follows:
[DataContract]
public class Persons
{
[DataMember]
public List<Person> Personas;
}
[DataContract]
public class Person
{
[DataMember(Name="SSN")]
public long SSN
{
get;
set;
}
[DataMember(Name="Name")]
public string Name
{
get;
set;
}
And when I run the DataContractSerializer the XML it returns is:
<Persons xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WCFTest">
<Personas>
<Person>
<Name>B</Name>
<SSN>1234</SSN>
</Person>
<Person>
<Name>I</Name>
<SSN>5678</SSN>
</Person>
</Personas>
</Persons>
I woul like to eliminate either element Persons or Personas, the root element should contain a list of Person.