public HttpResponseMessage EditListing(ListingDetailDTO listingDTO) { Listing listingToEdit = mapper.EditListingEntity(listingDTO); listingRepo.EditListing(listingToEdit); var response = Request.CreateResponse <ListingDetailDTO>(HttpStatusCode.Created, mapper.CreateListingDetailDTO(listingToEdit)); string uri = Url.Link("DefaultApi", new { id = listingToEdit.Id }); response.Headers.Location = new Uri(uri); return(response); }