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

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

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

            _mapper.Map(dto, registro);

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