public async Task <IActionResult> Details(string email) { var employee = await _accountManageService.GetEmployeeByEmailAsync(email); if (employee != null) { //deal with nulls later } var model = _mapper.Map <EmployeeDetailsViewModel>(employee); return(View(model)); }
public async Task <IActionResult> Profile() { var user = await _accountService.GetUserAsync(User); if (user == null) { throw new ApplicationException($"Unable to load user with email '{User.Identity.Name}'."); } var employee = await _accountManageService.GetEmployeeByEmailAsync(user.Email); var model = _mapper.Map <ProfileViewModel>(user); if (employee != null) { model = _mapper.Map(employee, model); } model.StatusMessage = StatusMessage; return(View(model)); }