コード例 #1
0
        public HttpResponseMessage Delete([FromBody] PREquipmentDTO pREquipmentDTO)
        {
            PREquipmentService.Delete(pREquipmentDTO);
            string tmp = string.Format($"{ pREquipmentDTO.PREquipID } has been deleted");
            HttpResponseMessage msg = Request.CreateResponse(HttpStatusCode.OK, tmp);
            string url = Url.Link("DefaultApi", new { id = pREquipmentDTO.PREquipID });

            msg.Headers.Location = new Uri(url);
            return(msg);
        }
コード例 #2
0
        public HttpResponseMessage Get(int id)
        {
            PREquipmentDTO pREquipmentDTO = PREquipmentService.Get(id);

            if (pREquipmentDTO == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound, "NotFound"));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, pREquipmentDTO));
        }