Beispiel #1
0
 public ActionResult CreateUser([FromBody] CreateUserRequest request)
 {
     try
     {
         UserAPI.CreateUser($"http://{Request.Host}", request);
         return(RedirectToAction("TaskIndex"));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Beispiel #2
0
 public void CreateDown()
 {
     UserAPI.CreateUser(nameField.text, (bool flag) => {
         if (flag)
         {
             Debug.Log("Create UserData!");
         }
         else
         {
             Debug.Log("Create failed...");
         }
     });
 }
Beispiel #3
0
        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));
        }