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();
        }
예제 #2
0
 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();
     }
 }
예제 #3
0
 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();
 }