public async Task <IActionResult> Register(RegiserUserModel model)
        {
            var isAdded = await this.userService.Add(model.Username, model.Password, model.ConfirmPassword, model.Email);

            if (!isAdded)
            {
                return(this.View());
            }

            return(this.Redirect("/Accounts/Login"));
        }
Пример #2
0
        public IHttpResponse Register(RegiserUserModel model)
        {
            var isAdded = this.userService.Add(model.Username, model.Password, model.ConfirmPassword, model.Email, "User");

            if (!isAdded)
            {
                return(this.BadRequestErrorWithView("Invalid registration data!"));
            }

            return(this.Redirect("/Users/Login"));
        }