public IActionResult GetCars()
        {
            var cars         = _carServices.GetAll();
            var carResponses = _mapper.Map <List <CarResponse> >(cars);

            return(Ok(carResponses));
        }
Beispiel #2
0
        public IActionResult GetAll()
        {
            var result = _carServices.GetAll();

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Beispiel #3
0
        public IActionResult GetAll()
        {
            var result = _carServices.GetAll();

            if (result.Success)
            {
                return(Ok(result.Data));
            }
            else
            {
                return(BadRequest(result.Message));
            }
        }
Beispiel #4
0
        public ActionResult <IEnumerable <CarEntity> > GetAll()
        {
            try
            {
                _logger.LogInformation("Received get request");

                return(Ok(_carServices.GetAll()));
            }
            catch (Exception exception)
            {
                _logger.LogError(exception, exception.Message);
                return(new StatusCodeResult(500));
            }
        }
        public async Task <JsonResult> GetCars()
        {
            var cars = await _carServices.GetAll();

            return(Json(cars));
        }