public ActionResult Details(int id) { CustomerDTO customer = customService.GetCustomer(id); var mapper = new MapperConfiguration(cfg => cfg.CreateMap <CustomerDTO, CustomerViewModel>()).CreateMapper(); var customView = mapper.Map <CustomerViewModel>(customer); return(View(customView)); }