public async Task <IActionResult> OnGetAsync() { var user = await _userManager.GetUserAsync(User); if (user == null) { return(NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.")); } await LoadAsync(user); return(Page()); }
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)); }