public IActionResult UpdateCar(string carId, CarModel carModel) { try { carModel.CarId = carId; CarModel updatedCar = carsLogic.UpdateCar(carModel); //if (updatedCar == null) // return NotFound($"id {carId} not found"); return(Ok(updatedCar)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }
public void UpdateCar(string carid, Cars car) { cLogic.UpdateCar(carid, car); }
public IActionResult EditCar(Cars c) { carsLogic.UpdateCar(c.CarId, c); return(RedirectToAction(nameof(ListCars))); }