I'm creating a program that has multiple independent processes that grab JSON from different sites. So I copy the JSON results and Paste Special into my project and it creates the associated class info. So the problem.
I paste in the first one and get like:
- public class Rootobject
- {
- public Datum[] data { get; set; }
- public Meta meta { get; set; }
- public Links links { get; set; }
- }
-
- public class Meta
- {
- public int count { get; set; }
- public string version { get; set; }
- }
-
- public class Links
- {
- public string self { get; set; }
- public string first { get; set; }
- public string last { get; set; }
- public string next { get; set; }
- }
-
- public class Datum
- {
- public string type { get; set; }
- public string id { get; set; }
- public Attributes attributes { get; set; }
- public Relationships relationships { get; set; }
- public Links4 links { get; set; }
- }
Then I go to the other source and get:
- 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; }
- public string season_number { get; set; }
- public string episode_number { get; set; }
- public string duration { get; set; }
- public int duration_raw { get; set; }
- public string rating { get; set; }
- public Regionalratings regionalRatings { get; set; }
- public string description { get; set; }
- public Thumb thumb { get; set; }
- public string url { get; set; }
- public string app_url { get; set; }
- public string amazon_est_url { get; set; }
- public string itunes_est_url { get; set; }
- public string streaming_url { get; set; }
- public string live_streaming_url { get; set; }
- public string tms_program_id { get; set; }
- public object show_id { get; set; }
- public string asset_type { get; set; }
- public string status { get; set; }
- public string expiry_date { get; set; }
- public bool is_paid_content { get; set; }
- public string ios_available_status { get; set; }
- public string ios_available_date { get; set; }
- public string android_available_status { get; set; }
- public string android_available_date { get; set; }
- public long tracking_media_id { get; set; }
- public object signature { get; set; }
- public object media_type { get; set; }
- public object vtag { get; set; }
- public bool is_live { get; set; }
- public int medTime { get; set; }
- public string genre { get; set; }
- public Metadata metaData { get; set; }
- public string brand { get; set; }
- public string[] videoProperties { get; set; }
- public string media_content_type { get; set; }
- public object mpd_url { get; set; }
- public object license_url { get; set; }
- public object closed_captions { get; set; }
- public int positionNum { get; set; }
- public bool is_protected { get; set; }
- public bool drm { get; set; }
- public string raw_url { get; set; }
- public string episode_title { get; set; }
- public object pubdate_iso { get; set; }
- public string thumbUrl { get; set; }
- public bool isUserSubscriber { get; set; }
- public string aaLink { get; set; }
- public string dataTracking { get; set; }
- public string displayTitle { get; set; }
- }
There is more to both of these but basically Rootobject and Datum are duplicated. Any way to deal with this?
Thanks.
JR