示例#1
0
        // DELETE: api/Schedule/5
        public HttpResponseMessage Delete(int id)
        {
            SchedulePersistence sp = new SchedulePersistence();
            bool isInSchedule      = false;
            HttpResponseMessage response;

            isInSchedule = sp.DeleteSchedule(id);
            if (isInSchedule)
            {
                response = Request.CreateResponse(HttpStatusCode.NoContent);
            }
            else
            {
                response = Request.CreateResponse(HttpStatusCode.NotFound);
            }

            return(response);
        }