public void DeleteUserCarsAndReservations(Customer user) { var cars = _unitOfWork.CarRepository.GetAll().Where(x => x.Customer == user).ToList(); foreach (var car in cars) { _manageCars.DeleteCarById(car.CarId); } }
public IActionResult DeleteConfirmed(int id) { _manageCars.DeleteCarById(id); return(RedirectToAction(nameof(Index))); }