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); }
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)); }