public void Edit(CarGridModel car) { decimal price = car.LastPrice; DateTime time = DateTime.Now; var carView = Mapper.Map <CarGridModel, CarViewModel>(car); carView.BrandId = (int)TempData["BrandID"]; carView.ModelId = (int)TempData["ModelID"]; //carView.Prices.Add(new CostViewModel { Date = time, Price = price }); ICostService costService = new CostService(); costService.UpdateLastCost(carView.Id, price); //carView.carService.GetCar(car.Id); carService.UpdateCar(Mapper.Map <CarViewModel, CarDTO>(carView)); }