public PartialViewResult CarsList(FilterCarModel filter, int page = 1) { var model = _mapper.Map <IEnumerable <CarItemModel> >(_carService.GetList(filter.IdCarDiagram)); model = model.ToPagedList(page, _pageSize); foreach (var item in model) { var carDiagram = _carDiagramService.Get(item.IdCarDiagram); if (carDiagram != null) { item.CarDiagramName = carDiagram.Name; item.TypeSeat = carDiagram.TypeSeat; } } ViewBag.IdCarDiagram = filter.IdCarDiagram; return(PartialView(model)); }
public ActionResult Edit(int id) { var model = _mapper.Map<CarDiagramModel>(_carDiagramService.Get(id)); return View(model); }