public async Task <IActionResult> ChangeUser() { var user = await _userHelper.GetUserByEmailAsync(User.Identity.Name); if (user != null) { if (await _userHelper.IsUserInRoleAsync(user, "Admin")) { var admin = _adminRepository.GetAdminByUserId(user.Id); var model = _converterHelper.ToChangeUserViewModelAdmin(admin); return(View(model)); } else if (await _userHelper.IsUserInRoleAsync(user, "Client")) { var client = _clientRepository.GetClientByUserId(user.Id); var model = _converterHelper.ToChangeUserViewModelClient(client); return(View(model)); } else if (await _userHelper.IsUserInRoleAsync(user, "Secretary")) { var secretary = _secretaryRepository.GetSecretaryByUserId(user.Id); var model = _converterHelper.ToChangeUserViewModelSecretary(secretary); return(View(model)); } else if (await _userHelper.IsUserInRoleAsync(user, "Mechanic")) { var mecanic = _mechanicRepository.GetMecanicByUserId(user.Id); var model = _converterHelper.ToChangeUserViewModelMecanic(mecanic); return(View(model)); } return(View()); } ; return(View()); }