public IActionResult GetCars() { var cars = _carServices.GetAll(); var carResponses = _mapper.Map <List <CarResponse> >(cars); return(Ok(carResponses)); }
public IActionResult GetAll() { var result = _carServices.GetAll(); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public IActionResult GetAll() { var result = _carServices.GetAll(); if (result.Success) { return(Ok(result.Data)); } else { return(BadRequest(result.Message)); } }
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)); }