public async Task <IActionResult> Register(RegisterRequestViewModel rvm) { var result = await RegisterAPI(rvm) as ObjectResult; if (result.StatusCode == StatusCodes.Status200OK) { return(Redirect("https://localhost:44302/")); } var errors = result.Value as ICollection <IdentityError>; foreach (IdentityError err in errors) { ModelState.AddModelError(string.Empty, err.Description); } return(View(rvm)); }