Instantiate object from Linq to XML Query
- by objectsbinding
Hi All
I have the following class
public class CountrySpecificPIIEntity
{
public string Country { get; set; }
public string CreditCardType { get; set; }
public String Api { get; set; }
public List<String> FilterList { get; set; }
}
I am trying to use a linq to XMl query to create a list of instances of type CountrySpecificPIIEntity.
The XML is as below
<piisettings>
<country countrycode="DE">
<creditcardype credicardtype="mastercard">
<api api="INSERT_FILTERS">
<filters>
<filter>FIRSTNAME</filter>
<filter>HOUSENUMBER</filter>
<filter>ADDITIONALADDRESSINFO</filter>
<filter>EMAIL</filter>
</filters>
</api>
</creditcardype>
<creditcardype credicardtype="visa">
<api api="INSERT_FILTERS">
<filters>
<filter>STATE</filter>
<filter>EMAIL</filter>
</filters>
</api>
</creditcardype>
<creditcardype credicardtype="visa">
<api api="UPDATE_FILTERS">
<filters>
<filter>STATE</filter>
<filter>EMAIL</filter>
</filters>
</api>
</creditcardype>
</country>
<country countrycode="GB">
<creditcardype credicardtype="americanexpress">
<api api="INSERT_FILTERS">
<filters>
<filter>STREET</filter>
<filter>ZIP</filter>
<filter>CITY</filter>
<filter>STATE</filter>
<filter>EMAIL</filter>
</filters>
</api>
</creditcardype>
<creditcardype credicardtype="debank">
<api api="INSERT_FILTERS">
<filters>
<filter>IPADDRESSCUSTOMER</filter>
<filter>FIRSTNAME</filter>
<filter>SURNAME</filter>
<filter>HOUSENUMBER</filter>
<filter>STREET</filter>
<filter>ZIP</filter>
<filter>CITY</filter>
<filter>STATE</filter>
<filter>EMAIL</filter>
</filters>
</api>
</creditcardype>
</country>
</piisettings>
what should the Linq to XML query be?