3

How to write a .net object for such a json data in c#? I don't know how to deal with startTime and endTime fields.

 {
 "webinarKey":5303085652037254656,
 "subject":"Test+Webinar+One",
 "description":"Test+Webinar+One+Description",
 "organizerKey":73563532324,
 "times":[{"startTime":"2011-04-26T17:00:00Z","endTime":"2011-04-26T18:00:00Z"}]
 }

I want to build a .net object first, then I can use JavaScriptSerializer to Deserialize it into the .net object. Thanks in advance.

1 Answer 1

1

It looks like the "times" property should look like this:

public List<TimeRange> Times{get;set;}

... which uses a second class that looks like this:

public class TimeRange
{
    public DateTime StartTime {get;set;}
    public DateTime EndTime {get;set;}
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.