I hope I'm not repeating this question but I couldn't find something that would help me.
I have the following .xml that I'd like to deserialize into my class.
<?xml version="1.0" encoding="UTF-8" ?>
<config>
<buildings>
<building>
<name>Name</name>
<id>1</id>
<build_time>750</build_time>
<time_factor>1.2</time_factor>
</building>
<building>
<name>Name</name>
<id>2</id>
<build_time>150</build_time>
<time_factor>1.8</time_factor>
</building>
<building>
<name>Name</name>
<id>3</id>
<build_time>950</build_time>
<time_factor>1.4</time_factor>
</building>
</buildings>
</config>
I would like to load name, id, building_time and time_factor from the element that has id = 2 into the following class.
public class Test
{
public string name { get; set; }
public int id { get; set; }
public int build_time { get; set; }
public double time_factor { get; set; }
}
What would be the best approach to do this task? Thank you.