public ActionResult UpdateFiltro(FiltroUpdateDto dto) { string token = Microsoft.AspNetCore.Authentication.AuthenticationHttpContextExtensions.GetTokenAsync(HttpContext, "access_token").Result; var response = HttpRequestFactory.Put(_configuration["Endpoints:Filtros"], dto, token).Result; _logger.LogInformation(string.Format("UpdateFiltro: StatusCode:{0} , RequestMessage:{1} ", response.StatusCode, response.RequestMessage)); return(convertMessage(response, response.ContentAsType <FiltroUpdateDto>())); }
public void Execute(FiltroUpdateDto dto) { var registro = _context.Filtros.SingleOrDefault(x => x.Id == dto.Id); if (registro == null) { throw new EntityNotFoundException("Filtro", dto.Id.ToString()); } _mapper.Map(dto, registro); _context.Save(); }
public ActionResult Put(FiltroUpdateDto dto) { _updateFiltro.Execute(dto); _logger.LogInformation(string.Format("Filtro Id:{0} Modificado por Usuario: {1} ", dto.Id, dto.Identity)); return(Ok()); }