public async Task <ActionResult <List <VeiculoDto> > > Get()
        {
            try
            {
                var veiculos = await veiculoService.GetAll(GetIdUsuarioLogado()).ToListAsync();

                var veiculosDto = mapper.MapList <Veiculo, VeiculoDto>(veiculos);
                return(Ok(veiculosDto));
            }
            catch (Exception ex)
            {
                return(BadRequest(new ErrorResponse(ex.Message)));
            }
        }
Exemple #2
0
        public IActionResult GetAll()
        {
            var result = service.GetAll();

            return(Ok(result));
        }