public TradingPartnerPropertyDto UpdateProperty(int tpid, TradingPartnerPropertyDto dto) { var entity = AutoMapper.Mapper.Map <TradingPartnerProperty>(dto); _propertyRepository.Update(entity); return(AutoMapper.Mapper.Map <TradingPartnerPropertyDto>(entity)); }
public IHttpActionResult UpdateProperty(int tpid, [FromBody] TradingPartnerPropertyDto dto) { try { var entity = _tpService.GetProperty(tpid, dto.Id); if (entity == null) { return(NotFound()); } return(Ok(_tpService.UpdateProperty(tpid, dto))); } catch (Exception ex) { //LOG //return StatusCode(HttpStatusCode.InternalServerError); return(InternalServerError(new Exception("An unexpected error occured! Please try again later!"))); } }