Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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));
        }