public ActionResult MaintenanceDetails(int maintenanceId) { var maintenance = maintenanceRepository.Get(maintenanceId); var car = carRepository.Get(maintenance.CarId); var customer = customerRepository.Get(maintenance.CustomerId); var master = masterRepository.Get(maintenance.MasterId.Value); var model = new MaintanceDetailsViewModel { Car = car, CustomerName = customer.Name, CustomerSurname = customer.Surname, Master = master, DateTime = maintenance.DateTime }; return(View(model)); }