public async Task <IActionResult> Index() { var user = await _userManager.GetUserAsync(User); var runnerUser = await _runnerRepo.GetUserAsync(user.Id); if (user == null) { throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); } var model = new IndexViewModel { Username = user.UserName, Email = user.Email, PhoneNumber = user.PhoneNumber, IsEmailConfirmed = user.EmailConfirmed, StatusMessage = StatusMessage, Name = runnerUser.Name, LastName = runnerUser.LastName, Sex = runnerUser.Sex, Birthday = runnerUser.Birthday, PhotoUri = runnerUser.PhotoUri }; return(View(model)); }
public async Task <IActionResult> Index() { var runner = await _runnerRepo.GetUserAsync(_userManager.GetUserId(User)); // ViewData["ProfilePhotoUri"] = runner.PhotoUri; IEnumerable <Activity> list = await _activityRepo.GetTrainingsAsync(runner.Id); return(View(list)); }