コード例 #1
0
        public ActionResult UpdateEstadoPerfil(EstadoPerfilUpdateDto dto)
        {
            string token    = Microsoft.AspNetCore.Authentication.AuthenticationHttpContextExtensions.GetTokenAsync(HttpContext, "access_token").Result;
            var    response = HttpRequestFactory.Put(_configuration["Endpoints:EstadoPerfiles"], dto, token).Result;

            _logger.LogInformation(string.Format("UpdateEstadoPerfil: StatusCode:{0} , RequestMessage:{1} ", response.StatusCode, response.RequestMessage));
            return(convertMessage(response, response.ContentAsType <EstadoPerfilUpdateDto>()));
        }
コード例 #2
0
        public void Execute(EstadoPerfilUpdateDto dto)
        {
            var registro = _context.EstadoPerfiles.SingleOrDefault(x => x.Id == dto.Id);

            if (registro == null)
            {
                throw new EntityNotFoundException("EstadoPerfil", dto.Id.ToString());
            }

            _mapper.Map(dto, registro);

            _context.Save();
        }
コード例 #3
0
 public ActionResult Put(EstadoPerfilUpdateDto dto)
 {
     _updateEstadoPerfil.Execute(dto);
     _logger.LogInformation(string.Format("EstadoPerfil Id:{0} Modificada por Usuario: {1} ", dto.Id, dto.Identity));
     return(Ok());
 }