So you need to update your ApplicationUser (or perhaps IdentityUser if you are using the default model i .NET Core Identity)? This is how you do it:
1) Inject UserMamager into your Page Model class:
public class SettingsModel : PageModel
{
private readonly UserManager<ApplicationUser> _userManager;
public SettingsModel(
UserManager<ApplicationUser> userManager
)
{
_userManager = userManager;
}
//Rest of the class...
}
2) Update the user's values in the OnPost-method:
public async Task<IActionResult> OnPost(int currentUserId)
{
if (!ModelState.IsValid)
{
return Page();
}
var user = await _userManager.FindByIdAsync(currentUserId);
user.FirstName = Input.FirstName;
user.LastName = Input.LastName;
await _userManager.UpdateAsync(user);
return Page();
}