コード例 #1
0
        private Response GetTimeTables()
        {
            if (mIsDebug)
            {
                Console.WriteLine("GET: /rest/v1/timetables");
            }

            return(Response.AsJson(TimeTableDTOConverter.ToDTO(_timeTableRepository.GetList(), FindCurrentSunSchedule())));
        }
コード例 #2
0
        private Response GetTimeTable(int id)
        {
            if (mIsDebug)
            {
                Console.WriteLine("GET: /rest/v1/timetables/{id}");
                Console.WriteLine("Id={0}", id);
            }

            var timeTable = _timeTableRepository.GetById(id);

            if (timeTable != null)
            {
                return(Response.AsJson(TimeTableDTOConverter.ToDTO(timeTable, FindCurrentSunSchedule())));
            }

            return(HttpStatusCode.NotFound);
        }