I want to create a custom XML structure as follows:
<Hotels>
<Hotel />
</Hotels>
I've created an implementation of List
just to be able to do this. My code is as follows:
[XmlRootAttribute(ElementName="Hotels")]
public class HotelList: List<HotelBasic>
Because the class that List holds is not named Hotel
but HotelBasic
my xml is like
<Hotels>
<HotelBasic />
</Hotels>
How do I fix this without having to implement ISerializable
or IEnumerable
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…