Click here to Skip to main content
15,908,264 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to find days between a defined date and now? Pin
Richard MacCutchan10-Nov-20 8:56
mveRichard MacCutchan10-Nov-20 8:56 
GeneralRe: How to find days between a defined date and now? Pin
Alex Dunlop10-Nov-20 16:48
Alex Dunlop10-Nov-20 16:48 
GeneralRe: How to find days between a defined date and now? Pin
Richard MacCutchan10-Nov-20 21:57
mveRichard MacCutchan10-Nov-20 21:57 
AnswerRe: How to find days between a defined date and now? Pin
Gerry Schmitz10-Nov-20 14:51
mveGerry Schmitz10-Nov-20 14:51 
GeneralRe: How to find days between a defined date and now? Pin
Alex Dunlop10-Nov-20 16:57
Alex Dunlop10-Nov-20 16:57 
GeneralRe: How to find days between a defined date and now? Pin
Gerry Schmitz10-Nov-20 18:11
mveGerry Schmitz10-Nov-20 18:11 
AnswerRe: How to find days between a defined date and now? Pin
Mycroft Holmes11-Nov-20 11:12
professionalMycroft Holmes11-Nov-20 11:12 
QuestionJSON "classes" repetitive Pin
Member 56973910-Nov-20 6:25
Member 56973910-Nov-20 6:25 
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? They are basically two independent JSON sets so not related to each other just two calls being made to different API's in the same program but both loop thru things independent of each other.

Thanks.
JR
AnswerRe: JSON "classes" repetitive Pin
Gerry Schmitz10-Nov-20 7:24
mveGerry Schmitz10-Nov-20 7:24 
GeneralRe: JSON "classes" repetitive Pin
Member 56973910-Nov-20 8:06
Member 56973910-Nov-20 8:06 
GeneralRe: JSON "classes" repetitive Pin
Gerry Schmitz10-Nov-20 14:33
mveGerry Schmitz10-Nov-20 14:33 
QuestionColor the intersected rectangles in c# windows applicaion Pin
Member 147377589-Nov-20 19:47
Member 147377589-Nov-20 19:47 
AnswerRe: Color the intersected rectangles in c# windows applicaion Pin
OriginalGriff9-Nov-20 20:12
mveOriginalGriff9-Nov-20 20:12 
QuestionLINQ results getting modified? Pin
Stellar Developer9-Nov-20 13:52
Stellar Developer9-Nov-20 13:52 
AnswerRe: LINQ results getting modified? Pin
Gerry Schmitz9-Nov-20 14:49
mveGerry Schmitz9-Nov-20 14:49 
GeneralRe: LINQ results getting modified? Pin
Stellar Developer9-Nov-20 15:56
Stellar Developer9-Nov-20 15:56 
GeneralRe: LINQ results getting modified? Pin
Gerry Schmitz9-Nov-20 23:43
mveGerry Schmitz9-Nov-20 23:43 
SuggestionRe: LINQ results getting modified? Pin
Richard Deeming9-Nov-20 21:58
mveRichard Deeming9-Nov-20 21:58 
QuestionWhat's Wrong With This??? Pin
Kevin Marois8-Nov-20 19:00
professionalKevin Marois8-Nov-20 19:00 
AnswerRe: What's Wrong With This??? Pin
Jörgen Andersson8-Nov-20 20:11
professionalJörgen Andersson8-Nov-20 20:11 
AnswerRe: What's Wrong With This??? Pin
Richard Deeming8-Nov-20 21:47
mveRichard Deeming8-Nov-20 21:47 
GeneralRe: What's Wrong With This??? Pin
Kevin Marois9-Nov-20 7:42
professionalKevin Marois9-Nov-20 7:42 
QuestionC# - Use app between 2 times and get the time from database Pin
Valakik8-Nov-20 12:16
Valakik8-Nov-20 12:16 
AnswerRe: C# - Use app between 2 times and get the time from database Pin
Dave Kreskowiak8-Nov-20 18:54
mveDave Kreskowiak8-Nov-20 18:54 
AnswerRe: C# - Use app between 2 times and get the time from database Pin
Gerry Schmitz9-Nov-20 1:51
mveGerry Schmitz9-Nov-20 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.