private async Task LoadAsync(SportUpUser user) { var userName = await _userManager.GetUserNameAsync(user); var phoneNumber = await _userManager.GetPhoneNumberAsync(user); var location = user.Location; Username = userName; AvailableSports = await _sportManager.GetSportsAsync(); EnrolledSports = _userManager.GetEnrolledSports(user); Input = new InputModel { PhoneNumber = phoneNumber, Location = location, }; }
public async Task <IActionResult> Index() { var currentUser = await _userManager.GetUserAsync(User); var allSports = await _sportManager.GetSportsAsync(); var viewModel = new TeamIndexViewModel() { AvailableSports = allSports, CurrentlyEnrolledTeams = _userManager.GetEnrolledTeams(currentUser), }; return(View(viewModel)); }