This should be a simple issue.
I have a data class, and json data, but I cant find a way to change the strong into a json object.
All help would be appreciated.
Here is the string
[{"CampaignID":"F1","Customer":"cust1","Language":"E","Content":[
{
"Type":"Email",
"Campaign":"t1",
"Card_type":"xxxxx",
"Last4":"xxxx",
"Name":"Rick",
"EmailAddress":"xxxxx@hotmail.com"
}
]},{"CampaignID":"F1","Customer":"cust1","Language":"E","Content":[
{
"Type":"Email",
"Campaign":"t1",
"Card_type":"xxxxxxxx",
"Last4":"xxxx",
"Name":"Donna",
"EmailAddress":"xxxxx@hotmail.com"
}
]},{"CampaignID":"t1","Customer":"f1","Language":"E","Content":[
{
"Type":"Email",
"Campaign":"t1",
"Card_type":"xxxxxx",
"Last4":"xxxx",
"Name":"Chelsea Bun",
"EmailAddress":"xxxxxxxxx-poo@hotmail.com"
}
]}]
And here are the classes
public class clsEmail
{
public string CompanyName { get; set; } = "";
public string Campaign { get; set; } = "";
public string CampaignID { get; set; } = "";
public string Customer { get; set; } = "";
public string Language { get; set; } = "";
public IList<Content> Content { get; set; }
}
public class Content
{
public string Type { get; set; }
public string Campaign { get; set; }
public string Card_type { get; set; }
public string Last4 { get; set; }
public string Name { get; set; }
public string EmailAddress { get; set; }
}
What I have tried:
I have tried to convert to json object, loop through an list as well as an array