public IActionResult Create(user_express user) { if (ModelState.IsValid) { var result = repository.AddUser(user); } return(RedirectToAction("Index")); }
public user_express Register([FromBody] user_express newUser) { try { var result = repository.AddUser(newUser); if (result.Succeeded) { this.hookManager.HookFired("register", this.repository.GetUser(newUser.actualUserName)); var res = repository.Login(newUser.actualUserName, newUser.password); if (res.Succeeded) { return(repository.GetUser_Express(newUser.actualUserName)); } } throw new Exception(); } catch { user_express tmp = new user_express(); tmp.clientMessage = "خطایی در ثبت کاربر بوجود آمده است."; return(tmp); } }