I want to deserialize an xml file using c#.
the file has this form:
<parent>
<TotProd Name="Total Produce Kwh">
<Time value="00:00:00">10</Time>
<Time value="00:30:00">10</Time>
............
</TotProd>
<ProdToNet Name="Produce to Net (iec)">
<Time value="00:00:00">10</Time>
<Time value="00:30:00">10</Time>
...........
</ProdToNet> .....
</parent>
I want to deserialize all child elements of parent into a List<Myclass> with TotProd/ProdToNet as a property of Myclass.
How can i do this.
You can use a common class for both elements, if they have the same structure:
UPDATE:
The
Time:valueseems like a TimeSpan duration object, so it can be presented as: