Esempio n. 1
0
        public IActionResult Details(int carId)
        {
            var car = _carService.GetById(carId);

            if (car != null)
            {
                var records = _rentedCarsRecordService.GetByCarPlateNumber(car.PlateNumber);
                var model   = new CarDetailsViewModel {
                    Car = car, Records = records
                };
                return(View(model));
            }

            TempData["message"] = "Failed to reach detail page !";
            return(RedirectToAction("Index", "Car"));
        }