public async Task <IActionResult> Details(int id) { var returnUrl = Request.Headers["Referer"].ToString(); var visit = await _visitRepo.GetVisit(id); VisitPersons = GetVisitPersons(id); VisitViewModel visitVm = VisitViewModelFactory.Details(visit, returnUrl, VisitTypes, Employees, Offices, RegisterControls, VisitStates, VisitPersons); return(View("Edit", visitVm)); }