コード例 #1
0
        public IActionResult AddUser(User user)
        {
            if (ModelState.IsValid)
            {
                user = _userServices.CreateUser(user);

                return(Ok(user));
            }
            Response.StatusCode = 200;
            return(BadRequest("User is not well introduced"));
        }
コード例 #2
0
 public User Create([FromBody] UserServiceModel user)
 {
     return(_usersServices.CreateUser(user));
 }
コード例 #3
0
        public IActionResult CreateUser(User user)
        {
            var newUser = _usersServices.CreateUser(user);

            return(CreatedAtRoute("GetUser", new { newUser.Username }, newUser));
        }