I'm attempting to setup a Web API endpoint that has a specific requirement that the XML format be similar to this:
<broadcast>
<name></name>
<description></description>
<episode>
<title></title>
</episode>
<episode>
<title></title>
</episode>
...
</broadcast>
My models look like this:
[DataContract]
public class broadcast
{
[DataMember]
public string name { get; set; }
[DataMember]
public string description { get; set; }
[DataMember]
public List<episode> episodes { get; set; }
}
[DataContract]
public class episode
{
[DataMember]
public string title { get; set; }
}
The problem I'm running into is that the episode items get put into a container tag <episodes>. Is there any way to serialize the episodes list so that the container tag doesn't appear?