예제 #1
0
        public ActionResult UpdateUniverso(UniversoUpdateDto dto)
        {
            string token    = Microsoft.AspNetCore.Authentication.AuthenticationHttpContextExtensions.GetTokenAsync(HttpContext, "access_token").Result;
            var    response = HttpRequestFactory.Put(_configuration["Endpoints:Universos"], dto, token).Result;

            _logger.LogInformation(string.Format("UpdateUniverso: StatusCode:{0} , RequestMessage:{1} ", response.StatusCode, response.RequestMessage));
            return(convertMessage(response, response.ContentAsType <UniversoUpdateDto>()));
        }
예제 #2
0
        public void Execute(UniversoUpdateDto dto)
        {
            var registro = _context.Universos.SingleOrDefault(x => x.Id == dto.Id);

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

            _mapper.Map(dto, registro);

            _context.Save();
        }
예제 #3
0
 public ActionResult Put(UniversoUpdateDto dto)
 {
     _updateUniverso.Execute(dto);
     _logger.LogInformation(string.Format("Universo Id:{0} Modificada por Usuario: {1} ", dto.Id, dto.Identity));
     return(Ok());
 }