public ActionResult <IEnumerable <Carro> > Get() { try { return(_carroService.Get().ToList()); } catch (Exception ex) { return(StatusCode(500)); } }
public ActionResult <Carro> Get([FromRoute] Guid key) { try { _logger.LogInformation("Received get request"); return(Ok(_carroService.Get(key))); } catch (Exception exception) { _logger.LogError(exception, exception.Message); return(new StatusCodeResult(500)); } }