public ActionResult CreateUser([FromBody] CreateUserRequest request) { try { UserAPI.CreateUser($"http://{Request.Host}", request); return(RedirectToAction("TaskIndex")); } catch (Exception e) { return(BadRequest(e.Message)); } }
public void CreateDown() { UserAPI.CreateUser(nameField.text, (bool flag) => { if (flag) { Debug.Log("Create UserData!"); } else { Debug.Log("Create failed..."); } }); }
public async Task <IActionResult> CreatUser([FromBody] UserModel userModel) { if (userModel.IsValid()) { // add to the db UserAPI.CreateUser(this._settings.Value.API.UserAPI, userModel); // set the cookie CookieUtility.SetEmail(this.HttpContext, userModel.Email); } return(Json(userModel)); }