public async Task<ActionResult> Register(RegisterModel model) { if (model.Password != model.PasswordConfirm) { model.Password = null; model.PasswordConfirm = null; ModelState.AddModelError("", "Passwords do not match!"); } if (ModelState.IsValid) { RegistrationResponseDto response = await _tenantService.RegisterUser(model.ToTenantDto()); if (response.Success) { return RedirectToAction("Success", "User"); } if (response.EmailExists) { ModelState.AddModelError("EmailAddress", "Email address already exists"); } } return View(model); }
public ActionResult Register() { var model = new RegisterModel(); return View("Register", model); }