コード例 #1
0
        public async Task <ApplicationUserViewModel> GetUserProfile()
        {
            string userId = User.Claims.First(claim => claim.Type == "UserID").Value;
            ApplicationUserViewModel user = await _applicationUserService.FindUserByIdAsync(userId);

            return(user);
        }
コード例 #2
0
        public async Task <ApplicationUserViewModel> ConfirmEmail(string userId, string code)
        {
            if (userId == null || code == null)
            {
                return(null);
            }

            ApplicationUserViewModel user = await _applicationUserService.FindUserByIdAsync(userId);

            IdentityResult result = await _applicationUserService.ConfirmEmail(user, code);

            if (result.Succeeded)
            {
                return(user);
            }

            return(null);
        }