コード例 #1
0
        public async Task <IActionResult> OnPostUpdateUserAsync(User updateUser)
        {
            if (updateUser.Id.Equals(Guid.Empty))
            {
                ViewData["updateUserError"] = "Id is not specified";
                return(Page());
            }
            User user = await _usersApi.GetUserById(updateUser.Id);

            UpdateUserValues(user, updateUser);
            if (await _usersApi.UpdateUser(user))
            {
                return(RedirectToPage());
            }
            ViewData["updateUserError"] = "Failed to update user";
            return(Page());
        }