How can I convert this Class into XML ? Or is there any possible way I can convert a JSON String for the same class directly into XML ? I am not getting an idea or a sample code to start with the conversion.
public class Contacts
{
public Datum[] data { get; set; }
public Info info { get; set; }
}
public class Datum
{
public Owner Owner { get; set; }
public object Email { get; set; }
public string Description { get; set; }
public string currency_symbol { get; set; }
public string Mailing_Zip { get; set; }
}
public class Owner
{
public string name { get; set; }
public string id { get; set; }
}
public class Info
{
public int per_page { get; set; }
public int count { get; set; }
public int page { get; set; }
public bool more_records { get; set; }
}
Please help in converting the Class to XML or the JSON String based on the above class into an XML directly.
The scenario is that, I am receiving a JSON result from the API and this result needs to be processed in the SQL Server where the datatype has been kept as XML. I am hoping that this can be achieved successfully.