public IActionResult Consultar([FromRoute] ConsultarCervejaDTO.Envio dto) { if (!ModelState.IsValid) { NotifyModelStateErrors(); return(Response(dto)); } var result = _cervejaAppService.ConsultarCerveja(dto); return(Response(result, true)); }
public ConsultarCervejaDTO.Retorno ConsultarCerveja(ConsultarCervejaDTO.Envio dto) { var cerveja = _mapper.Map <CervejaModel>(UnitOfWork.CervejaRepository.GetById(dto.Id)); if (cerveja == null) { Bus.RaiseEvent(new Notification("Search", "Nenhum registro localizado para os filtros informados!")); } return(new ConsultarCervejaDTO.Retorno() { Cerveja = cerveja }); }