Ejemplo n.º 1
0
        public DocumentTypeResolverDto UpdateResolver(int docTypeId, DocumentTypeResolverDto dto)
        {
            var entity = AutoMapper.Mapper.Map <DocumentTypeResolver>(dto);

            _resolverRepository.Update(entity);

            return(AutoMapper.Mapper.Map <DocumentTypeResolverDto>(entity));
        }
Ejemplo n.º 2
0
        public IHttpActionResult Update(int doctypeid, [FromBody] DocumentTypeResolverDto dto)
        {
            try
            {
                var entity = _docTypeService.GetResolver(doctypeid, dto.Id);

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

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