I have this class:
public class Campaign{
public int campaign_id { get; set; }
public string campaign_name { get; set; }
public int representative_id { get; set; }}
And I can deserialize the JSON
to a List
like this:
Campaigns = JsonConvert.DeserializeObject<List<Campaign>>(jsonstring);
But I want to access the items base on the campaign_name, how can I do that? How to Deserialize it to a dictionary where the value will be the object and the key will be the campaign_name? Thank you.