IdentityResult reports whether an ASP.NET Core Identity operation succeeded and exposes the errors produced when it failed. UserManager.CreateAsync returns it as Task<IdentityResult> after attempting to create an IdentityUser. section 38.3.3
Use the result to choose the request-processing path:
- Check Succeeded; redirect to the user list when creation succeeds. section 38.3.3
- Enumerate Errors when creation fails, and copy each IdentityError.Description into ModelState with ModelState.AddModelError. section 38.3.3
...
if (result.Succeeded) {
return RedirectToPage("List");
}
foreach (IdentityError err in result.Errors) {
ModelState.AddModelError("", err.Description);
}
...
The compact result-handling branch shows the practical success and failure paths. section 38.3.3
