public TradingPartnerIdentifierDto UpdateIdentifier(int tpid, TradingPartnerIdentifierDto dto)
        {
            var entity = AutoMapper.Mapper.Map <TradingPartnerIdentifier>(dto);

            _identifierRepository.Update(entity);

            return(AutoMapper.Mapper.Map <TradingPartnerIdentifierDto>(entity));
        }
Ejemplo n.º 2
0
        public IHttpActionResult UpdateProperty(int tpid, [FromBody] TradingPartnerIdentifierDto dto)
        {
            try
            {
                var entity = _tpService.GetIdentifier(tpid, dto.Id);

                if (entity == null)
                {
                    return(NotFound());
                }

                return(Ok(_tpService.UpdateIdentifier(tpid, dto)));
            }
            catch (Exception ex)
            {
                //LOG
                //return StatusCode(HttpStatusCode.InternalServerError);
                return(InternalServerError(new Exception("An unexpected error occured! Please try again later!")));
            }
        }