public async Task <IActionResult> SignUp(SignUp signUp) { if (ModelState.IsValid) { var res = await signInManager.UserManager.CreateAsync( new User { UserName = signUp.UserName, Email = signUp.Email }, signUp.Password); if (res.Succeeded) { displayUserRepository.Add(signUp.UserName); return(Redirect("~/")); } else { foreach (var err in res.Errors) { ModelState.AddModelError("", err.Description); } } } return(View(signUp)); }