public IHttpActionResult AddFacility(int id, [FromBody] NewFacilityDto value) { var entity = Svc.GetById(id); if (entity == null) { return(NotFound()); } var facility = value.ToEntity(); int facilityId = Svc.AddFacility(id, facility); var createdDto = new FacilityDto(); createdDto.LoadFromEntity(facility); return(CreatedAtRoute("GetFacilityById", new { id = facilityId }, createdDto)); }