示例#1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            var user = await _context.GetAppUserAsync(Username);

            if (user == null)
            {
                return(NotFound($"Unable to load user with ID '{Username}'."));
            }

            var mentor = user.Mentor;

            if (mentor == null)
            {
                return(Redirect("/Error"));
            }

            await _context.AddMentorAboutAsync(mentor, Input.About);

            return(Redirect("./Address"));
        }
示例#2
0
        public async Task <IActionResult> OnGetAsync()
        {
            var user = await _context.GetAppUserAsync(Username);

            this.UserType = this.PopulateUserType(user);

            return(Page());
        }