public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("NotFound", "Error"));
            }
            var carDM = await _carServices.FindCar(id);

            CarViewModel carVM = new CarViewModel();

            AutoMapper.Mapper.Map(carDM, carVM);
            if (carVM == null)
            {
                return(RedirectToAction("NotFound", "Error"));
            }
            return(PartialView("Details", carVM));
        }
Exemplo n.º 2
0
        // GET: Car/Details/5
        public async Task <IActionResult> Details(int id)
        {
            Car car = await _carServ.FindCar(id);

            return(View(car));
        }