public override string Handle(string input) { if (Context.HttpMethod == HttpMethod.Get) { var dl = new ReadDataLayer(); var attendeeList = dl.GetAttendeeList(); return(JsonConvert.SerializeObject(attendeeList)); } throw new NotSupportedException(); }
public override void Handle(string input) { if (Context.HttpMethod == HttpMethod.Get) { var dl = new ReadDataLayer(); var conferenceList = dl.GetConferenceList(); Context.WriteContent(JsonConvert.SerializeObject(conferenceList)); } else { throw new NotSupportedException(); } }
public override string Handle(string input) { if (Context.HttpMethod == HttpMethod.Get) { var dl = new ReadDataLayer(); StringValues id; if (Context.QueryParameters.TryGetValue("id", out id)) { var conferenceId = Guid.Parse(id[0]); var conference = dl.GetConferenceDetail(conferenceId); return(JsonConvert.SerializeObject(conference)); } throw new ArgumentNullException("id"); } throw new NotSupportedException(); }