Assume i have the class
public class Test1
{
public int BINID { get; set; }
public int NUMBER1 { get; set; }
public decimal HOLGRAPHIC { get; set; }
public Test1(int id, int num, decimal hol)
{
BINID = id;
NUMBER1 = num;
HOLGRAPHIC = hol;
}
}
Assume i have created a List collection of Test1 in another class called Test2. In Test2 class i have created the collection t of Test1.
List<Test1> t = new List<Test1>();
Assume this List contains two Test1 objects. How do i convert the List to XML to have the following schema?
<t>
<Test1>
<BINID>23</BINID>
<NUMBER1>123</NUMBER1>
<HOLOGRAPHIC>2345.12</HOLOGRAPHIC>
</Test1>
<Test1>
<BINID>3</BINID>
<NUMBER1>346233</NUMBER1>
<HOLOGRAPHIC>12.345</HOLOGRAPHIC>
</Test1>
</t>