Beispiel #1
0
        public ActionResult SignUp(UserDataModel model)
        {
            if (ModelState.IsValid)
            {
                if (_userService.GetByEmail(model.Email) != null)
                {
                    ModelState.AddModelError(ErrorMessages.Error, ErrorMessages.EmailExists);
                }
                else
                {
                    _modelRepository.CreateUserFromModel(model);
                    TempData["message"] = ErrorMessages.AccountCreated;
                    return(RedirectToAction("SignIn"));
                }
            }

            return(View());
        }