public async Task <ActionResult <IEnumerable <TrocaResource> > > GetById(int id) { var troca = await _trocaService.GetById(id); if (troca == null) { return(NotFound("Troca não encontrado")); } var trocaResource = _mapper.Map <TrocaResource>(troca); return(Ok(trocaResource)); }
public TrocaViewModel GetById(int trocaId) { return(Mapper.Map <Troca, TrocaViewModel>(_trocaService.GetById(trocaId))); }