I have some JSON that I deserialize by doing like:
Rootobject rootObject = JsonConvert.DeserializeObject(rawJSON);
That gets put into things like:
- public class Rootobject
- {
- public Result result { get; set; }
- public bool success { get; set; }
- }
- public class Result
- {
- public string title { get; set; }
- public Datum[] data { get; set; }
- public int total { get; set; }
- }
- public class Datum
- {
- public string type { get; set; }
- public string title { get; set; }
- public string series_title { get; set; }
- public string label { get; set; }
- public string content_id { get; set; }
- public string airdate { get; set; }
- public long airdate_ts { get; set; }
- public DateTime airdate_iso { get; set; }
- public string expiredate_raw { get; set; }
Everything working great. That said, I want to now run
Rootobject rootObject = JsonConvert.DeserializeObject(rawJSON);
again with a different set of JSON data. Basically a different feed but the exact same layout. Will all the above class objects still have the old data in it and when I loop thru that data will just be appended to it? If so is there a way to clear all values before looping thru the second process without creating two programs that run separately?